Ninjakreborn Posted August 6, 2010 Share Posted August 6, 2010 The no_enddate. When it's checked it should hide the end date field and disable it. When it's not checked it shouldn't. This was working fine. Now all of a sudden I added "registered_headline". If that checkbox is checked then the stuff for no_enddate doesn't work. If it isn't checked, then it continues to work fine. Any advice? <label for="registered_headline">Only show to registered users:</label><input name="registered_headline" <?php if ($registered_headline == 1) { echo 'checked="checked"'; } ?> type="checkbox" class="checkbx" /> </fieldset> <fieldset class="choosedates"><legend>Run Dates</legend> <label for="start_date"><span style="color:red;">*</span>Start Date:</label><br/><input name="start_date" id="start_date" class="date_pick" type="text" value="<?php echo $start_date; ?>" /><br /> <br/><label for="no_enddate"><strong>Run Promotion continuously with no end date?</strong></label> <script type="text/javascript"> $(document).ready(function() { if ($("input[@name='no_enddate']:checked").val() == 'yes') { $('#end_date').attr('disabled', 'disabled'); $('.end_date').hide(); }else { $('#end_date').attr('disabled', ''); $('.end_date').show(); } $('.enddatecheck').click(function() { if ($("input[@name='no_enddate']:checked").val() == 'yes') { $('#end_date').attr('disabled', 'disabled'); $('.end_date').hide(); }else { $('#end_date').attr('disabled', ''); $('.end_date').show(); } }); }); </script> <?php if ($no_enddate == 1) { echo '<div class="inputgroup">Yes<input id="enddate_yes" class="radio enddatecheck" type="radio" name="no_enddate" value="yes" checked="checked" />No<input type="radio" name="no_enddate" id="enddate_no" value="no" class="radio enddatecheck" /></div>'; }else { echo '<div class="inputgroup">Yes<input class="radio enddatecheck" type="radio" id="enddate_yes" name="no_enddate" value="yes" />No<input class="radio enddatecheck" type="radio" name="no_enddate" value="no" id="enddate_no" checked="checked" /></div>'; } ?><br/><br/> <span class="end_date"> <label for="end_date">End Date:</label><br/><input name="end_date" id="end_date" class="date_pick" type="text" value="<?php echo $end_date; ?>" /><br /> </span> Quote Link to comment Share on other sites More sharing options...
Ninjakreborn Posted August 6, 2010 Author Share Posted August 6, 2010 All I have been able to verify is that when the registered headline is checked then the other is always defaulting to "no" and if it isn't it works fine. Any advice here? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.