Page 1 of 1

how can i add value of textbox in listbox in php

Posted: Tue Apr 24, 2007 8:52 am
by amthree
Hi,

how can i add value of textbox in listbox in php. I have a textfield and want to type information in the textbox and after enter or submit add the value in a listbox, clear the textbox, and again type information in the textbox and add the value again in de listbox and so on in a loop for about 10/24 times. So the listbox is growing with all the values I entered in the textbox. And if it can all in the same php-page.

I am a novice to php so maybe someone can help me with a php-script that can do this.


Thanx in advance,


Amthree

Posted: Tue Apr 24, 2007 9:08 am
by feyd
You will either be using sessions or dynamically generating hidden input tags with the value information to update the list box.

If you want more help, please ask specific questions. It helps us if you post your code too.

Posted: Wed Apr 25, 2007 1:06 am
by Mohit_Prog
in the lostfocus event of a textbox, fire the submit action of the form. submit the form to itself( i mean same page) .
now fetch the request from a textbox parameter and store in some variable say $test.

your listbox should be filled such a way that if $test contains something then assign it to a listbox.

try this. if still not clear then ask some specific question from this reply.