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
form value not taking.......
Moderator: General Moderators
-
Swathimaddipatla
- Forum Newbie
- Posts: 9
- Joined: Fri May 09, 2008 7:08 am
-
WebbieDave
- Forum Contributor
- Posts: 213
- Joined: Sun Jul 15, 2007 7:07 am
Re: form value not taking.......
What happens? What's in the $_POST array? Try:Swathimaddipatla wrote:but its not working...
Code: Select all
var_dump($_POST);Also, try changing the method to get temporarily so you can more easily examine what's being sent (you can change $_POST to $_REQUEST or $_GET to access the parameters).