Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Accessing HTML values in JSP without submitting

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to access a value in a textbox through JSP without submitting the page. Any suggestions? There doesn't seem to be a mechanism for it, as request.getParameter() only gets values from the requesting page. Also, in a scriptlet, all statements must be complete, so can't do something like this:
<%
String s = new String("
%>
<script type="text/javascript" defer="defer">
document.getElementById("textfieldname");
</script>
<%
");
//do something with String s
%>
Any suggestions? Thanks.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you should start with a plain HTML file containing the Javascript that works the way you want, then turn that into a JSP page.
I think you are confusing the roles of Javascript on the client and server-side programming. JSP can only work with a browser request.
Bill

------------------
author of:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic