Attention:

Support Rules and Guidelines
Before you post your support topic, please remember to:
  • Read the support forum rules.
  • Check the wiki and use search to see if your problem can be answered there first.
  • Link your board please, and make sure that the problem on your board is visible to guests or provide a test account.
  • Do not post Board Wrappers and CSS unless requested. With a board link, this is not necessary.
  • Be as descriptive as you can and use as many details as possible when describing your problem.
  • Please briefly mark any links to forums that may not be work-safe.
This will help ensure your support issue will be attended to in a quick and efficient manner.

  ClosedNew TopicNew Poll

 Hiding empty fields on custom mini profile [SOLVED]
#
I've looked at a lot of topics explaining it, but I'm brand spanking new to coding(started yesterday ha ha...) and I can't seem to get the code to remove empty fields from the mini-profile.

CODE
<!-- |status| -->
<!-- |avatar| -->
<span class=‘char-power’><!-- |field_2| --></span>
Group: <!-- |member_group| -->
Posts: <!-- |member_posts| -->
Joined: <!-- |member_joined| -->
<span class=‘char-age’>Age: <!-- |field_1| --></span>

<span class=‘char-strength’>Stg: <!-- |field_3| --></span>
<span class=‘char-speed’>Spd: <!-- |field_4| --></span>
<span class=‘char-will’>Will: <!-- |field_5| --></span>
<span class=‘char-constitution’>Con: <!-- |field_6| --></span>
<span class=‘char-focus’>Fcs: <!-- |field_7| --></span>

<span class=‘char-died’>Died: <!-- |field_8| --></span>


This is what I have so far for the mini-profile template. Based on what I've read on the forums, I should use this code

CODE
<script>$('.char-power:contains("N/A")').remove();</script>
<script>$('.char-age:contains("N/A")').remove();</script>
<script>$('.char-strength:contains("N/A")').remove();</script>
<script>$('.char-speed:contains("N/A")').remove();</script>
<script>$('.char-will:contains("N/A")').remove();</script>
<script>$('.char-constitution:contains("N/A")').remove();</script>
<script>$('.char-focus:contains("N/A")').remove();</script>
<script>$('.char-died:contains("N/A")').remove();</script>


in order to remove those fields that I want gone when they're left empty and come up as 'N/A'.

1. I don't know if I even got the coding right.
2. If it is, then I have no clue where to put it. It doesn't work when I put it in the profile template code-box.

Please help! Thanks so much!
PM
#
Try this coding, I use this on my own forums for this effect simply change the information to match yours as done in this example. This goes right into the mini-profile coding.

CODE
<script>if("<!-- |field_3| -->" !='N/A') { document.write("<span class=‘char-strength’>Stg: <!-- |field_3| --></span>"); } </script>


So yours would look like this, however you will probably need to add </br> tags to space it out correctly.

CODE
<!-- |status| -->
<!-- |avatar| -->
<script>if("<!-- |field_2| -->" !='N/A') { document.write("<span class=‘char-power’><!-- |field_2| --></span>"); } </script>
Group: <!-- |member_group| -->
Posts: <!-- |member_posts| -->
Joined: <!-- |member_joined| -->
<script>if("<!-- |field_1| -->" !='N/A') { document.write("<span class=‘char-age’>Age: <!-- |field_1| --></span>"); } </script>

<script>if("<!-- |field_3| -->" !='N/A') { document.write("<span class=‘char-strength’>Stg: <!-- |field_3| --></span>"); } </script>
<script>if("<!-- |field_4| -->" !='N/A') { document.write("<span class=‘char-speed’>Spd: <!-- |field_4| --></span>"); } </script>
<script>if("<!-- |field_4| -->" !='N/A') { document.write("<span class=‘char-will’>Will: <!-- |field_5| --></span>"); } </script>
<script>if("<!-- |field_6| -->" !='N/A') { document.write("<span class=‘char-constitution’>Con: <!-- |field_6| --></span>"); } </script>
<script>if("<!-- |field_7| -->" !='N/A') { document.write("<span class=‘char-focus’>Fcs: <!-- |field_7| --></span>"); } </script>


<script>if("<!-- |field_8| -->" !='N/A') { document.write("<span class=‘char-died’>Died: <!-- |field_8| --></span>"); } </script>

signature

user posted image
YouTube | Email: crystal@jcink.com | Blog: Seriously Lacqueing
DeviantArt
#
Thanks so much!

It works exactly as written so I didn't have to mess with it at all! I'll use this as a base from now on. ^^
PM
#
This topic has been solved. If you need anymore help please post a new thread. Thanks for choosing Jcink services.

signature

user posted image
YouTube | Email: crystal@jcink.com | Blog: Seriously Lacqueing
DeviantArt
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
Share this topic:
« Next Oldest | General Support | Next Newest »

Options ClosedNew TopicNew Poll