aspose file tools*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 12671
    
    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:


Java Resources at www.wbrogden.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Accessing HTML values in JSP without submitting
 
Similar Threads
Error handling in JSp's
Can't get first JSTL to work
passing a variable from html/jsp to javascript
JSP with JavaScript and Comments
passing object from JSP to Javascript