Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

counting how many text boxes have been used

Status
Not open for further replies.

ciaranm

Programmer
Feb 22, 2002
1
IE
hello,

could you please help with the following problem,say i have four text boxes in a form on a web page and the user has entered a name in each of the three text boxes how can i count that three of these text boxes have been accessed

thank you.
 
Check the value of each - and see that they are not empty - you could add sophistication by doing a pattern match I guess.
b2 - benbiddington@surf4nix.com
 
or if you are just interested in how many they used, not whether they are empty or not, you could use something like this:
<script>
var boxes = new Array();

function focused(x)
{
boxes[boxes.length] = x.name;
}
</script>

<inpu type=&quot;text&quot; name=&quot;bob&quot; onfocus=&quot;focused(this);&quot;> luciddream@subdimension.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top