Win a copy of Design for the Mind this week in the Design 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