Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-18-2005, 05:20 PM   PM User | #1
niceguy_reddy
New to the CF scene

 
Join Date: Mar 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
niceguy_reddy is an unknown quantity at this point
Form field validation

Hello,

I wrote a php page which contains some input fields of type text which are generated by using a for loop in php. The names for the input fields are generated by appending the value incremented in the for loop in php. eg. st0,st1,st2-----. Now i need to check using javascript that some value is entered in the input fields. How can i do that using a for loop in javascript.

The php code i used to generate the text fields are:

<form name=f method=post action=test.php>
<?php
$count=5;
for($i =0;$i<count;$i++)
{
echo "<input type=text name="st".$i>";
}
?>
</form>


The html o/p for the above code will be:

<form name=f method=post action=test.php>
<input type=text name=st0>
<input type=text name=st1>
<input type=text name=st2>
<input type=text name=st3>
<input type=text name=st4>
</form>

How can i check that whether a value is entered into the fields or not in javascript.
niceguy_reddy is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:09 PM.


Advertisement
Log in to turn off these ads.