[Logo]
Forums Register Login
Accessing HTML values in JSP without submitting
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.
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:
pie. tiny ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss


This thread has been viewed 494 times.

All times above are in ranch (not your local) time.
The current ranch time is
Jul 21, 2018 13:29:44.