form value not taking.......
Posted: Thu Jul 10, 2008 5:51 am
Hi...
am using calender to select DOB in my form..
for that i have used java script.
how need to take value of DOB from form and need to insert into DB
my form is
<html>
<head>
<script language="JavaScript" type="text/javascript" src="calendar.js"></script>
</head>
<body>
<form action="action.php" method="post">
<table>
<tr>
<td width="117"><b>Date of birth</b></td>
<td width="14">:</td>
<td width="357"><script>DateInput('birthdate', true, 'YYYY-MM-DD')</script></td>
<td><input type="button" onClick="alert(this.form.birthdate.value)" value="Show date value passed"></td>
</tr><tr><td></td><td><input type="submit" name="Register" id="Register" value="Register" ></td></tr></table></form></body>
</html>
And in action.php i have given
<?php
if (isset($_POST['Register']))
{
$dob = $_POST['birthdate'];
some insert stmt....
}
?>
but its not working...
pls tell me how to solve this...
Now how to pass javascript variable into php
am using calender to select DOB in my form..
for that i have used java script.
how need to take value of DOB from form and need to insert into DB
my form is
<html>
<head>
<script language="JavaScript" type="text/javascript" src="calendar.js"></script>
</head>
<body>
<form action="action.php" method="post">
<table>
<tr>
<td width="117"><b>Date of birth</b></td>
<td width="14">:</td>
<td width="357"><script>DateInput('birthdate', true, 'YYYY-MM-DD')</script></td>
<td><input type="button" onClick="alert(this.form.birthdate.value)" value="Show date value passed"></td>
</tr><tr><td></td><td><input type="submit" name="Register" id="Register" value="Register" ></td></tr></table></form></body>
</html>
And in action.php i have given
<?php
if (isset($_POST['Register']))
{
$dob = $_POST['birthdate'];
some insert stmt....
}
?>
but its not working...
pls tell me how to solve this...
Now how to pass javascript variable into php