hi dudes,
i got a problem in my web application. i have a JSP page with table. it contains one header row which comes from the database(i.e i take the values of that header from DB and put them in a string Tokenizer and display) and under that the respective Textboxes to enter the data for them.
here i can add any no of ROWs by clicking some button. all this adding of rows i have written in Java Script.
now i got the problem that, i have to write code for Validations for all these fields! i can do that all for the initial row becas it have specific names for them. but for dynamically created rows, all the text boxes in that row having same name. so how can i validate them seperaterly becas they contain different types of data.
pl help me in this regard.
cheers,
uday garikapti
-
validatons for dynamically created page (2 messages)
- Posted by: uday garikapati
- Posted on: July 20 2004 01:57 EDT
Threaded Messages (2)
- Re: validatons for dynamically created page by Piotr Maj on July 20 2004 14:39 EDT
- Re: validatons for dynamically created page by Tazz Man on July 27 2004 13:42 EDT
-
Re: validatons for dynamically created page[ Go to top ]
- Posted by: Piotr Maj
- Posted on: July 20 2004 14:39 EDT
- in response to uday garikapati
i can do that all for the initial row becas it have specific names for them. but for dynamically created rows, all the text boxes in that row having same name.
Hi Uday,
so why don't you name the generated fields i.e. name_1, name_2, etc. or in any other way which whould leave you full control over what value should be expected unter given name?
If you do so, the rest should be easy.
--
Piotr Maj -
Re: validatons for dynamically created page[ Go to top ]
- Posted by: Tazz Man
- Posted on: July 27 2004 13:42 EDT
- in response to Piotr Maj
You dont have to name them name_1, name_2
You can acess them through an array, from the document, form objects and index through them using afor loop. I just dont remember how. Google can always help lol