Naming a Textbox

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
glennalmeda
Forum Newbie
Posts: 14
Joined: Mon Jan 26, 2004 9:00 pm

Naming a Textbox

Post 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! :)
ilovetoast
Forum Contributor
Posts: 142
Joined: Thu Jan 15, 2004 7:34 pm

Post by ilovetoast »

Code: Select all

<input type="text" name="qty<?php echo $row&#1111;'id']; ?>" size="4" value ="<?php echo $quantity; ?>">
peace
glennalmeda
Forum Newbie
Posts: 14
Joined: Mon Jan 26, 2004 9:00 pm

Post 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.
ilovetoast
Forum Contributor
Posts: 142
Joined: Thu Jan 15, 2004 7:34 pm

Post 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
Post Reply