This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cant able to get focus at perticular textfield in javascript

 
kavita vala
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a problem with javascript focus()

I have a html page in which i have



And a javascript file isgiven below
validate.js



So in above code i cant able to get focus in text field.
What can i do please help me.

 
vijin das
Ranch Hand
Posts: 129
Firefox Browser Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
your code is working in IE 7 when i tested pasting it on blank html and embeded js function in the same page ...

whether are you refering your js file from html page like this


if not change..like this
or
then just try whether your validate function is getting called just tring this way

if that is working then your other code also should work ..otherwise it will be problem with your browser ...>
 
kavita vala
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I get alert and all functionality but cant able to only set focus to text field
 
vijin das
Ranch Hand
Posts: 129
Firefox Browser Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
kavita vala wrote:I get alert and all functionality but cant able to only set focus to text field

which browser you are using ??? any other controlls (field s ) are there in that page ???
 
Eswar Nec
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Focus using, both form and field id.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic