Note that there are some explanatory texts on larger screens.

plurals
  1. PODIV "hiding" when changing dropdown value
    primarykey
    data
    text
    <p>This is related to a previous question I asked: <a href="https://stackoverflow.com/questions/17739945/hide-show-multiple-divs">Hide / Show Multiple Divs</a></p> <p>I have the code in place from my previous question and it seems work ok apart from when I change a value in a dropdown "AFTER" the ticket selection is made.</p> <p>I have a number of Javascrpts in place so wondering if there is a clash somewhere? The first bit of code is in the HEAD of the document.</p> <pre><code>&lt;head&gt; &lt;script type="text/javascript"&gt; $(function() { $('.cat_dropdown').change(function() { $('#payMethod').toggle($(this).val() &gt;= 2); }); }); &lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function () { $(".paymentmethod").click(function () { $(".paymentinfo").hide(); switch ($(this).val()) { case "Credit Card Authorisation": $("#pay0").show("slow"); break; case "Direct Deposit": $("#pay1").show("slow"); break; case "Cash Payment (FAA Office)": $("#pay2").show("slow"); break; } }); }); &lt;/script&gt; &lt;/head&gt; </code></pre> <p>This second section of code is the form verification:</p> <pre><code> &lt;script src="/CatalystScripts/ValidationFunctions.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; //&lt;![CDATA[ var submitcount27389 = 0;function checkWholeForm27389(theForm){ var why = ""; if (theForm.FirstName) why += isEmpty(theForm.FirstName.value, "First Name"); if (theForm.LastName) why += isEmpty(theForm.LastName.value, "Last Name"); if (theForm.HomeAddress) why += isEmpty(theForm.HomeAddress.value, "Home Address"); if (theForm.HomeCity) why += isEmpty(theForm.HomeCity.value, "Home City"); if (theForm.HomeState) why += isEmpty(theForm.HomeState.value, "Home State"); if (theForm.HomeZip) why += isEmpty(theForm.HomeZip.value, "Home Zipcode"); if (theForm.HomeCountry) why += checkDropdown(theForm.HomeCountry.value, "Home Country"); if (theForm.EmailAddress) why += checkEmail(theForm.EmailAddress.value); if (theForm.HomePhone) why += isEmpty(theForm.HomePhone.value, "Home Phone Number"); if (theForm.CAT_Custom_266106) why += checkDropdown(theForm.CAT_Custom_266106.value, "Available Dates:"); if (theForm.CAT_Custom_266143) why += checkDropdown(theForm.CAT_Custom_266143.value, "Member Tickets:"); if (theForm.CAT_Custom_266107) why += checkDropdown(theForm.CAT_Custom_266107.value, "Guest Tickets:"); if (theForm.CAT_Custom_266105 &amp;&amp; theForm.CAT_Custom_266107.value != "1") why += checkSelected(theForm.CAT_Custom_266105, "Payment Options:"); if (theForm.CAT_Custom_266104) why += checkDropdown(theForm.CAT_Custom_266104.value, "Where did you hear about us?"); if (theForm.CaptchaV2) why += captchaIsInvalid(theForm, "Enter Word Verification in box below", "Please enter the correct Word Verification as seen in the image"); if(why != ""){ alert(why); return false; } if(submitcount27389 == 0){ submitcount27389++; theForm.submit(); return false; }else{ alert("Form submission is in progress."); return false; } } //]]&gt; &lt;/script&gt; &lt;/form&gt; </code></pre> <p>The page can be found at <a href="http://www.faa.net.au/test/femmes-event-rego-form.html" rel="nofollow noreferrer">http://www.faa.net.au/test/femmes-event-rego-form.html</a> if you would like to test it and see the results.</p> <p>You need to select more than 1 GUEST, then CREDIT CARD AUTHORISATION and then finally select something in the "Where did you hear about us?" dropdown to see what happens.</p> <p>I dont understand why the DIV hides once I change a value in the last dropdown menu??</p> <p>I have added a JSFiddle - <a href="http://jsfiddle.net/4REan/" rel="nofollow noreferrer">http://jsfiddle.net/4REan/</a> - but I cant get it working properly but hopefully with all the code there it will help??</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload