Hi
I have developed a finance site but the form needs altering, I need the form to display previous address fields if their current address is less than 3 years
I have put together some coding but don't seem to be working
Also be good to use jquery datepicker but I couldn't get that to work for some reason, it showed the calendar but did not seem to have any css styling to it and would not enter the date into the input text field so wondering if it was a jquery issue somewhere, I left that for now and gone with select dropdowns if someone could take a look at my coding to help me get it working first then look at the datapickerCode:<div class="row-single"> <label>Moving In Date</label> <select name="moveindate1day"> <option value="">---Select date---</option> <?php for ($i = 1; $i <= 31; $i++) : ?> <option value="<?php echo ($i < 10) ? '0'.$i : $i; ?>"><?php echo $i; ?></option> <?php endfor; ?> </select> <select name="moveindate1month"> <option value="">---Select month---</option> <?php for ($i = 1; $i <= 12; $i++) : ?> <option value="<?php echo ($i < 10) ? '0'.$i : $i; ?>"><?php echo $i; ?></option> <?php endfor; ?> </select> <select name="moveindate1year" id="year1" onchange = "three()"> <option value="">---Select year---</option> <?php for ($i = 1930; $i < date('Y'); $i++) : ?> <option value="<?php echo $i; ?>"><?php echo $i; ?></option> <?php endfor; ?> </select> </div> <div id="extra" name="extra" style="display: none"> <div class="row-single"> <label>Address 2</label> </div> <div class="clearfix"></div> <div class="row-double"> <div class="leftcol"> <label>Flat</label> <input name="flat2" type="email" value="" maxlength="50" /> </div> <div class="leftcol"> <label>Property Name</label> <input name="propertyname2" type="email" value="" maxlength="50" /> </div> </div> <div class="clearfix"></div> <br /> <div class="row-double"> <div class="leftcol"> <label>Property Number</label> <input name="propertynumber2" type="email" value="" maxlength="50" /> </div> <div class="leftcol"> <label>Street Name</label> <input name="streetname2" type="email" value="" maxlength="50" /> </div> </div> <div class="clearfix"></div> <br /> <div class="row-double"> <div class="leftcol"> <label>Town</label> <input name="town2" type="email" value="" maxlength="50" /> </div> <div class="leftcol"> <label>Postcode</label> <input name="postcode2" type="email" value="" maxlength="50" /> </div> </div> <div class="clearfix"></div> <br /> <div class="row-single"> <label>Moving In Date</label> <select name="moveindate2day"> <option value="">---Select date---</option> <?php for ($i = 1; $i <= 31; $i++) : ?> <option value="<?php echo ($i < 10) ? '0'.$i : $i; ?>"><?php echo $i; ?></option> <?php endfor; ?> </select> <select name="moveindate2month"> <option value="">---Select month---</option> <?php for ($i = 1; $i <= 12; $i++) : ?> <option value="<?php echo ($i < 10) ? '0'.$i : $i; ?>"><?php echo $i; ?></option> <?php endfor; ?> </select> <select name="moveindate2year"> <option value="">---Select year---</option> <?php for ($i = 1930; $i < date('Y'); $i++) : ?> <option value="<?php echo $i; ?>"><?php echo $i; ?></option> <?php endfor; ?> </select> </div> </div> <script> function three() { var yr = new Date().getFullYear(); // current year var dv = Number(document.getElementById("year1").value); if ((dv == yr) || dv == yr-1) || dv == yr-2) || dv = yr-3)) { document.getElementById("extra").style.display = "block"; } else { document.getElementById("extra").style.display = "none"; } } </script>
Thank you in advance
Bookmarks