php - html form-- need help having new input area populate if radio button is clicked -
php - html form-- need help having new input area populate if radio button is clicked -
i making basic new client database mysql , php. when people click on radio button"different mailing address" couple of input fields appear mailing address. im not quite sure how handle inputs , not variables. there way if statement here html form code below
<form method="post" action="insert.php"> <fieldset> <legend>new client data</legend> <label>complete below</label> <div class="controls controls-row"> <input class="span4" name="firstname" type="text" placeholder="first name"> <input class="span3" name="lastname" type="text" placeholder="last name"> <input class="span3" name="phone" type="text" placeholder="phone"> </div> <div class="controls controls-row"> <input class="span4" name="address" type="text" placeholder="address"> <input class="span2" name="city" type="text" placeholder="city"> <input class="span1" name="state" type="text" placeholder="state"> </div> <div class="controls controls-row"> <input class="span4" name="zip" type="text" placeholder="zip code"> <input class="span2" name="email" type="text" placeholder="email"> <input class="span2" name="ccemail" type="text" placeholder="cc email"> </div> <span class="help-block">when customers due date monthly</span> <label class="radio"> <input type="radio" name="duedate" id="optionsradios1" value="1" checked> 1st of month</label> <label class="radio"> <input type="radio" name="duedate" id="optionsradios2" value="15"> 15th of month </label> <span class="help-block">mailing address</span> <label class="radio"> <input type="radio" name="mailingaddress" id="optionsradios3" value="1" checked> check if mailing address same service address </label> <label class="radio"> <input type="radio" name="mailingaddress" id="optionsradios4" value="0"> check if mailing address different </label> <button type="submit" class="btn btn-primary">submit</button> </fieldset> </form>
using jquery, have 2 inputs hidden. 1 time user checks box, '$.show()' on 2 inputs. id have div containing 2 inputs, , show or hide div depending on whether box checked or not
php jquery html mysql
Comments
Post a Comment