• Post Reply Bookmark Topic Watch Topic
  • New Topic

Accessing Scriplets Value Inside Javascirpt  RSS feed

 
manish mcool
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Is it possible to access the scriptlets value inside the Javascript. Actually, I want to enable/Disable the text box on the basis of Scriplet variable value.

Thanks in Advance.

Regards
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't use scriptlets, ever. But I have been known to do this.



Works just fine.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65900
135
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by manish mcool:
Is it possible to access the scriptlets value inside the Javascript.

No. JSP executes on the server and JavaScript on the client. Please read this article for a better understanding of how JSP operates.

As Gregg pointed out, what you can do is to use the JSP the create JavaScript that does what you want.

But if all you want to do is to enable or disable a field based upon a server value, why use JavaScript at all? Just write the JSP to set the disabled attribute as appropriate.
[ February 01, 2008: Message edited by: Bear Bibeault ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!