Page 1 of 1

Naming a Textbox

Posted: Mon Jan 26, 2004 9:00 pm
by glennalmeda
PLease help.

<input type="text" name="qty' .$row['id']. '" size="4" value ="' .$quantity. '">

i want the name of the textbox to be "qty + the id number".
(e.g id = 1, the name of the textbox should be "qty1")
I dont know if my syntax above is correct.
can u check or give me the correct syntax for this problem.

and how can i get/use the value assigned in the textbox?

Thank You! :)

Posted: Mon Jan 26, 2004 9:52 pm
by ilovetoast

Code: Select all

<input type="text" name="qty<?php echo $row&#1111;'id']; ?>" size="4" value ="<?php echo $quantity; ?>">
peace

Posted: Mon Jan 26, 2004 9:54 pm
by glennalmeda
On the next page, i need to refer to that textbox.


php:
--------------------------------------------------------------------------------
$newQty = $('qty'.$row['id']);
?>

--------------------------------------------------------------------------------



i used the code above to save the value of the textbox to a new variable but its not working.

Posted: Mon Jan 26, 2004 10:26 pm
by ilovetoast
Is the form method get or post? change GET to POST if its a post....

Code: Select all

$newQty = $_GET&#1111;'qty' . $row&#1111;'id']];
peace