php - Selected radio button make field true or false -
i have following code:
<?php $radioswitch = of_get_option('radio_switch'); if ($radioswitch == "true") { ?> <!-- radio switch --> <div class="row switches clearfix"> <input type="radio" name="switch" id="switch1" value="<?php echo of_get_option('switch1'); ?>" /><label for="switch1" class="field"><?php echo of_get_option('switch1'); ?></label> <input type="radio" name="switch" id="switch2" value="<?php echo of_get_option('switch2'); ?>" /><label for="switch2" class="field"><?php echo of_get_option('switch2'); ?></label> </div> <?php } ?> ................................................................................ <?php $datepicker1 = of_get_option('datepicker1'); $datepicker2 = of_get_option('datepicker2'); if (($datepicker1 == "true") || ($datepicker2 == "true")) { ?> <div class="row clearfix"> <?php if ($datepicker1 == "true") { ?> <!-- datepicker 1 --> <input type="text" id="datefrom" name="<?php echo of_get_option('datepicker1_text'); ?>" value="<?php echo of_get_option('datepicker1_text'); ?>" tabindex="6" /> <label class="error" for="datefrom" id="datefrom_error">selectați data.</label> <?php } ?> <?php if ($datepicker2 == "true") { ?> <!-- datepicker 2 --> <input type="textarea" id="dateto" name="<?php echo of_get_option('datepicker2_text'); ?>" value="<?php echo of_get_option('datepicker2_text'); ?>" tabindex="7" /> <label class="error" for="dateto" id="dateto_error">selectați data.</label> <?php } ?> </div> <?php } ?>
if radio button "switch1" selected, "$datepicker1" must true , "$datepicker2" must false, , if radio button "switch2" selected, both "$datepicker1" , "$datepicker2" must true. me?
php server-side language parsed on server. cannot modify variables of php on browser.
try submitting radio button options form php page.
Comments
Post a Comment