• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

textfield.focus() problem

 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the magical code you are talking about that has errors?

Eric
 
Rajni Patel
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry, this is the code






thanks
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic