Re: Smart ass form
| From: | Richard Lynch | Date: | Sun, 21 Jul 2002 20:23:06 +0000 |
| Subject: | Re: Smart ass form | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-108750@lists.php.net to get a copy of this message | ||
>Hi all. I have this form with some dynamically made fields. One of them
>fields is truly making me nuts. The thing is, I have a table in which I
>store the user id, the development language he/she uses and the time
>he/she has been using it. Something like this:
>
>+--------+--------+------------------+-------------------------+
>| expid | devid | devlanguage | devtime |
>+--------+--------+------------------+-------------------------+
>| 1 | 1 | PHP | less than 1 year |
>| 2 | 1 | MySQL | less than 1 year |
>| 3 | 1 | HTML | more than 5 years |
>+--------+------+--------------------+-------------------------+
>
>Now, in the HTML form I want to display each language along with a
>checkbox for selection and a dropdown with a list of time periods. Some
>tough me in this list about naming the form fields like language[] in
Don't use just language[]
Use language[$devid]
>order to create an array and use it when it was not empty. Fine, the
>thing is that I also want to display a list of some 3 blank textboxes
>along with time periods drop downs so anyone who knows another language
>can add it to the list... the questions are as follows:
>
>1) What would be the best approach to do this and how should I
>call all the checkboxes, textfields and drop downs?
Same answer.
Use some reasonable variable name, with [$devid] after it.
>2) How can I manage them after the form was submitted?
while (list($dev_id, $lang) = each($language)){
}
--
Like Music? http://l-i-e.com/artists.htm