This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes Create a grid and capture values under them Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Create a grid and capture values under them " Watch "Create a grid and capture values under them " New topic
Author

Create a grid and capture values under them

Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Hi ,

This is a requirement , i need to work on , there is a grid like structure ( similar to a table with many rows and cells in form of TextFields)

When the user fills up these cells and enter on submit button , i need to validate those values under onClick button .

Please give me an idea as how to proceed with this task ??

Thanks in advnace .


Save India From Corruption - Anna Hazare.
Harpreet Singh janda
Ranch Hand

Joined: Jan 14, 2010
Posts: 317

What type of validation do you want

You can provide the id to each text box like text1,text2,..............textn ad on onClick event you can call a java script method where you can iterate on a loop from 1 to n (take a vaiable i for iteration) and get the element by using getElemntById('text'+i) method and perform the validation after getting the value of the elmement like:


Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Harpreet , Thanks for the idea .

i know how to ceate grid in javascript using for loop , but didn't knew the extraction logic of them . Now its clear .
Thanks man once again .
 
Consider Paul's rocket mass heater.
 
subject: Create a grid and capture values under them
 
Similar Threads
looking for good grid for html
Live Data Grid using Rico
Database grid and detailed view
DataGrid: update cell without refreshing page
Grid Layout : Gap appears mysteriously in between cells.