• Post Reply Bookmark Topic Watch Topic
  • New Topic

Help with syntax  RSS feed

 
David Garratt
Ranch Hand
Posts: 216
Eclipse IDE Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<input tabindex='3' type="submit" name="buttonSubmit" id="buttonSubmit" value=<%Lang.getText("btn_Add"); %> onclick="document.palletInfo.button.value='Submit';" /> 

In the above line I have just amended the value= part to return a value from a bean. I can see from the logger output displayed in the tomcat dos window that my bean is being called and that its returning a string "Add".

However the button is being displayed with wron text. The html source view of the page returns as


<input tabindex='3' type="submit" name="buttonSubmit" id="buttonSubmit" value= onclick="document.palletInfo.button.value='Submit';" /> 

Can anyone give me a clue

thanks in advance

Dave
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why is the value attribute not quoted? Sloppy markup usually creates problems.
 
Vivek sri
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this
<%= Lang.getText("btn_Add") %>
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Insert usual caveat about using Java scriptlets in a JSP 9 years after they've been discredited.
 
Paul Clapham
Sheriff
Posts: 22509
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I haven't used that old-style code for years, but if I recall correctly you're using the form which executes a line of code rather than the form which evaluates an expression and returns its value.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!