Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

disable text box

 
priya pillai
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends

I want to disable my text box using java script.

Here "a" is the line number where change dynamically

var remarks="remarks"+a
var remarks_1=document.getElementById(remarks)

document.f_update.remarks_1.disabled== "true";

f_update is the form name.

It is not working..
thanks in advance
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
== is a comparison

Eric
 
priya pillai
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I used

document.f.remarks_1.disabled = true;

Still not working...

 
Paul Clapham
Sheriff
Posts: 21133
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps if you change "f.remarks_1" back to "f_update.remarks_1"...
 
priya pillai
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I changed the form name also to f that is why


stil not working

out.println("<input type=\"text\" size = \"14\" name=\"remarks" + SNo+ "\" value=\"" + remarks+ "\">");


where SNo is the serial number which change
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why would you find it by id than try to look it up via the form?

All you would need to do is

remarks_1.disabled=true;

Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic