This topic is locked

get data from form

2/4/2009 6:54:33 AM
PHPRunner General questions
S
sickacid author

hi i want ho put some data in a table, but my code don't work..

i want to get the value form "infopallet" form, but with this code

$p = $values["infopallet"]; i get the value form "id lookup" and not

te really value that i can see in the form..
in after record added..
//** Custom code ****

// put your custom code here

global $conn;

$i = $values["Colli"];

//$p = $values["infopallet"];

$p = document.addform.value_infopallet.value; ...this is a example what i want to do

J
Jane 2/4/2009

Hi,
you've mixed PHP and JavaScript code.

I suppose you need to select actual value from database using ID.

Here is a sample:

global $conn;

$id = $values["infopallet"];

$str = "select FieldName from LookupTable where IDField=".$id;

$rs = db_query($str,$conn);

$data = db_fetch_array($rs);

$p = $data["FieldName"];



where FieldName, IDField are your actual field names, LookupTable is your actual table name.