Jump to content
Updating IPB tonight Read more... ×


This topic is now archived and is closed to further replies.


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

Recommended Posts

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....


Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.