PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Hide State/Province Error if required

  1. Einsteinno1
    Member

    Hi,

    I wanted to hide the State/Province field because nobody need this field in Germany. I found this code and added it to my css

    span#input_2_11_4_container {display:none} /* hide region from view */
    span#input_2_11.3_container {float:right!important; margin-right:16px!important} /* move city field to right */

    It works smoothly and the field is hidden and city is moved to the right. But the problem is that if somebody wants to fill out the whole form I will get everytime an error because there is a empty field which is required in the ADDRESS field. It is normal because the State field is hidden, but if the whole address field is set to required he wants this field to be filt out.

    Any idea to solve this problem?

    Posted 14 years ago on Saturday June 26, 2010 | Permalink
  2. Einsteinno1
    Member

    I looked already in the common.php and I can see the state field inside. I would be happy if this field would get an standard value of "01" and than I could hide it. But I don't know how to give this field a standard value.

    Posted 14 years ago on Saturday June 26, 2010 | Permalink
  3. I believe the ability to hide the State / Province / Region field is being added for the next release scheduled for early next week. There will be a checkbox option under the "hide country" option. If hidden it won't trigger validation if the field is set as required.

    If it's something you need right away, you can always populate the field with some jQuery on load, and hide it with CSS the way you detailed in your first post. That way there's already a value in the field and the validation won't trigger on it.

    Something like this..

    <script type="text/javascript">
    jQuery.noConflict();
      jQuery(document).ready(function($) {	
    
       		$('#input_1_28_4_container input').attr('value','n/a');
    
      });
    </script>

    Where "#input_1_28_4_container" is the correct ID for your form.

    If you're not in a giant rush, then look for a fix in the release next week.

    Posted 14 years ago on Sunday June 27, 2010 | Permalink
  4. Einsteinno1
    Member

    thx anyway, will wait with it until next week. I have to finish this Massage Salon Website until the 15th of July. So still time to fix it.

    Posted 14 years ago on Monday June 28, 2010 | Permalink

This topic has been resolved and has been closed to new replies.