Jump to content


urgent.plz help.how to access javascript variable in mysql!

  • Please log in to reply
No replies to this topic

#1 dipsnaik

  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 03 April 2003 - 05:23 AM

hi alll...
my prob is how to assecc a php variabl;e in a java script funtion
e.g in the below code we have populated a drop down menu with values given...
this value we want to access in the javascript function.. in mssql query...
i know that i can access that varianble using document.formname.varaibe;.value...
but how to access this form\'s drop down menu.. in the mssql query...
echo \"<script type=text/Javascript> n\";
echo \"function rent()n\";
echo \"alert(document.ganapati.ss1.value)n\"; // this value is prnitng fine
$res=mysql_query(\"select login from user_details where user_id=\'$sho\'\");
echo \"document.ganapati.t.value=\"$t1\";n\";
echo \"alert(document.ganapati.t.value)n\";
echo \"} n\";
echo \"</script>n\";

<form name=\"ganapati\" method=\"post\">
<select name=\"ss1\" onchange=\"rent();\">
<option value=\"1001\"> Ha </option>
<option value=\"1006\"> Dhapni </option>
<option value=\"1002\"> Brown SHirt </option>
<input type=\"text\" name=\"s\">
<input type=\"text\" name=\"t\">

whenever we hard code the where clause \'s value.. its gving the output correctly...
how to access java script varable in the MySQL query??????????
plzzzzzzzzzzzzzzz help....
thanx in advance....
Impossible = I + m+ possible [br]Deeps

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users