mbarandao
12-21-2010, 04:26 PM
Good day all:
I want to get the value of a textbox into php without clicking the submit button. Any advice... Here is what I have
My form field:
#1
<input type="text" style=background:transparent; border:0px; name='clientid' >
This field is populated dynamically by its name with another php script in this way
#2
echo "formObj.clientid.value = '".toSafeString($inf["clientID"])."';\n";
Now I want to take the value in code#1 (name='clientid') and pass it to a php code that is in the same file as the form. Here is the php code
<?php
$name=$_POST['name'];//this is where the value of the text box mentioned is defined
include 'datalogin.php';
error_reporting(0);
error_reporting(E_ERROR | E_WARNING | E_PARSE);
//test
//get image details
$uploaddir = "images/clientsimages/";
$get_data = "SELECT i.uploadedfile, i.clientid " . " FROM images AS i, ajax_client AS a " . " WHERE i.clientid = a.clientID " . " AND a.clientID = $name";
$get_data_res = mysql_query($get_data) or die(mysql_error() . '<br>sql : '.$get_data);
if (mysql_num_rows($get_data_res) > 0)
{
while ($get_data_info = mysql_fetch_array($get_data_res))
{
$uploadedfile = $uploaddir . $get_data_info["uploadedfile"];
}
}
?>
I know this may require js, but I appreciate any help!
I want to get the value of a textbox into php without clicking the submit button. Any advice... Here is what I have
My form field:
#1
<input type="text" style=background:transparent; border:0px; name='clientid' >
This field is populated dynamically by its name with another php script in this way
#2
echo "formObj.clientid.value = '".toSafeString($inf["clientID"])."';\n";
Now I want to take the value in code#1 (name='clientid') and pass it to a php code that is in the same file as the form. Here is the php code
<?php
$name=$_POST['name'];//this is where the value of the text box mentioned is defined
include 'datalogin.php';
error_reporting(0);
error_reporting(E_ERROR | E_WARNING | E_PARSE);
//test
//get image details
$uploaddir = "images/clientsimages/";
$get_data = "SELECT i.uploadedfile, i.clientid " . " FROM images AS i, ajax_client AS a " . " WHERE i.clientid = a.clientID " . " AND a.clientID = $name";
$get_data_res = mysql_query($get_data) or die(mysql_error() . '<br>sql : '.$get_data);
if (mysql_num_rows($get_data_res) > 0)
{
while ($get_data_info = mysql_fetch_array($get_data_res))
{
$uploadedfile = $uploaddir . $get_data_info["uploadedfile"];
}
}
?>
I know this may require js, but I appreciate any help!