netsys
Posts: 39
|
Posted: 09/24/2010, 9:45 AM |
|
I'm using the Add A Row function for an editable grid, so that users can "add a row" by clicking a button, which essentially shows another blank row.
I need to loop through the values on the confirmation button on several of the fields and check them against regular expressions in javascript. I'm using Nicole's advice for looping through control values: http://forums.codecharge.com/posts.php?post_id=60507
Right now, I'm getting the values for every field, whether blank or filled. How can I loop through only those where something is in the text box - for example, where class_end_time.value !== ""?
Here's the code I've got now on the submit button:
initClass_TimesElements(); for(var j = 0; j < Class_TimesElements.length; j++){ alert('End Time:' + Class_TimesElements[j][Class_TimesClass_End_TimeID].value); }
This is what gives me the value of every row. I tried the advice of putting in the for statement: for(var j = 0; j < <form_name>Elements.length-<form_name>EmptyRows; j++)
but am getting no results, I think because it considers all my rows to be empty at this point.
Any ideas? Thanks.
|