checkbox always in unchecked status no matter if is checked or not -
i using chekbox in code showing unchecked .i using chekbox show below in form , on submit ion cheking value if statement shown below
<label class="checkbox"> <input type="checkbox" name="auto"><p>i accept </p> </label> if(isset($_post['auto'])) { echo "checked"; } else { echo "unchecked"; }
some browser not support defalut value of "on". more stable solution -
<label class="checkbox"> <input type="checkbox" name="auto" value="on" /><p>i accept </p> </label>
and same php code.
if(isset($_post['auto'])) { echo "checked"; } else { echo "unchecked"; }
Comments
Post a Comment