Click to See Complete Forum and Search --> : javascript in php checkbox


Jaydeep
05-05-2006, 01:23 PM
hello friends,

I am having a page and a textbox on that and a submit button.

The page is submitted to itself...

when user submits the some processing happens and the check box

is shown below the textbox..

if i click on checkbox the textbox should be filled with the data that

i wrote before i submited the page.

so i want javascript...

and here is what i have done..

on starting....

$ballname1=$_GET['txtballname1'];
//with this i am getting the last value...

echo "<html>";
?>
<script language="javascript">

function setball()
{
var Lform = this.document.advbbsearch2;

Lform.txtballname1.value = <?$ballname1;
?>
return true;
}
</script>
<?echo "<head>";

////here other processing happenss...

and here is the code for check box

echo "<input type=\"checkbox\" name=\"chkbox1\" value=\"ball1\" onclick=\"setball()\" align=\"right\">";

so how can i fill textbox with the previous values....