DidYouGetThatMemo
New Member
I am looking for a piece of code in Javascript/Jquery to show and hide html form based on Radio button so that it can work in iPhone/iPad as well. Here is what I am expecting.Choiceickup (Radio Button)Delivery (Radio Button)Based on the choice aboveIf it is Pickup.Display a HTML FORM with few inputs to show the address of the place where items are being picked up.If it is DeliveryDisplay a HTML Form with few inputs to accept delivery address.and submit the data.Any suggestions..?I have tried the following with select box rather than radio box.\[code\]<pre> <!doctype html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script> <script> $(document).ready(function (){ $("#state").change(function() { // foo is the id of the other select box if ($(this).val() != "Pickup") { $("#foo").show(); }else{ $("#foo").hide(); } }); }); </script> </head> <body> <h3> Select Pickup Or Delivery:</h3> <p> <select id="state" name="state" style="width: 212px;"> <option value="http://stackoverflow.com/questions/14543730/Pickup">Pickup</option> <option value="http://stackoverflow.com/questions/14543730/Delivery">Delivery</option> </select> </p> <p id="foo" style="display:none;"> <h4> Pickup Location:</h4> 123 Main St, Edison NJ </p> <p id="foo" style="display:none;"> <form> <h3> Enter your address below:</h3> <label>Address1</label> <input type="text" name="address1"><br> <label>Address2</label> <input type="text" name="address2"><br> <label>City</label> <input type="text" name="city"><br> <label>State</label> <input type="text" name="state"><br> <label>Zip Code</label> <input type="text" name="zipcode"><br> </p> </body></pre>\[/code\]