This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Accessing HTML values in JSP without submitting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Accessing HTML values in JSP without submitting" Watch "Accessing HTML values in JSP without submitting" New topic
Author

Accessing HTML values in JSP without submitting

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
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

Joined: Mar 22, 2000
Posts: 12761
    
    5
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:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Accessing HTML values in JSP without submitting
 
Similar Threads
passing a variable from html/jsp to javascript
JSP with JavaScript and Comments
passing object from JSP to Javascript
Can't get first JSTL to work
Error handling in JSp's