| Author |
textfield.focus() problem
|
Rajni Patel
Ranch Hand
Joined: Sep 03, 2009
Posts: 84
|
|
Hi,
I have more than 2 text field in html. I want to validate first field and if its not validate and than alert shows on page. and i don't want to send control on second field. so I wrote in onchange event on this field and in this I wrote this.focus() and this.select(); but its not work. If only one field in form than this problem solved but for more than 2 field it can not solve. Please any body can help me.
Thanks
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
|
|
What is the magical code you are talking about that has errors?
Eric
|
 |
Rajni Patel
Ranch Hand
Joined: Sep 03, 2009
Posts: 84
|
|
its not error coming. But control is going on next field.
<code>
<form name="validationForm">
<table>
<tr>
<td>First Name:</td><td><input type ="text" name="firstName"></td>
</tr>
<tr>
<td>Last Name:</td><td><input type ="text" name="lastName" ></td>
</tr>
<tr>
<td>Email Id:</td><td><input type ="text" id="emailIdText" name="emailid"
onChange = " if (custInfo.validate.validation.validateEmailAddress() == false){
alert('in jsp');
this.focus();
this.select();
} "></td>
<td><div id ="emailIdValidationDiv"></div></td>
</tr>
</code>
Thanks
|
 |
Rajni Patel
Ranch Hand
Joined: Sep 03, 2009
Posts: 84
|
|
sorry, this is the code
thanks
|
 |
 |
|
|
subject: textfield.focus() problem
|
|
|