...

View Full Version : Checkbox Input



DiNozzo
11-09-2011, 09:12 AM
Hey guys!

I'm kind'a stuck in this problem:
I got a checkbox that I want to have a default value as checked, but when you uncheck it and submit it stays unchecked untill you check it and submit again. (Atleast while you stay on the site and don't close the browser)

So this is what I got:


<?php

$_POST['RNC101V'] ? $RNC101_Checked = ' checked="checked" ' : $RNC101_Checked = '';

?>

<div style="width=200px; height=1000; float=right; border=solid 1px;">

<form method="POST" action"index.php">

<input type="checkbox" name="RNC101V" <?php echo $RNC101_Checked ?>/>RNC101<br />
<input type="submit"/>

</form>

</div>



Help is much appreciated!

Regards
Jonathan

sunfighter
11-09-2011, 04:00 PM
This is the way it is suppose to work. You unchecked it and it stays unchecked . You don't want your boxes to do what ever they want.

The checked="checked" attribute sets the initial condition.

BTW Your code will not work.

DiNozzo
11-09-2011, 04:06 PM
This is the way it is suppose to work. You unchecked it and it stays unchecked . You don't want your boxes to do what ever they want.

The checked="checked" attribute sets the initial condition.

BTW Your code will not work.

BTW. My code does work, and I managed to fix it by myself... -.-"



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum