Please Help…
I need to assign a servlet URL dynamically in the ACTION= inside the FORM Tag.
I have a javascript function getServletURL() which returns a string specifying the URL to a java servlet like this:
function getServlet() {
var servletURL;
.
.code to determine servlet here…
.
return(servletURL);
}
And the Form tag is :
<FORM id=”form1″ Name=”form1″ Action=”javascript:getServletURL()” method=post>
When the form is submitted, the servlet URL string is displayed in a blank HTML page as a regular character string. Nothing else is on that page.
If the Form tag is changed to :
<FORM id=”form1″ Name=”form1″ Action=”getServletURL()” method=post>
then I get a “HTTP status 404” and it tried to access “getServlet()” under the same directory / URL as the current web page.
What am I doing wrong? How do I make it take the servlet URL (for example: “....
Please Help.
Many Thanks,
K.