Hi Everybody,
Scenario:
User enters input into <form> page:
<form name="form1" action="" onsubmit="submitclick()">
<input type="text" name="user" value="">
<input type="submit" name="submit" value="submit">
JavaScript (located at bottom of this <form> page) tests:
<script>
{
re1 = /\s/;
var user = document.form1.user.value;
if(user == null || user.search(re1) != -1)
{
location.reload();
}
else
{
window.location = \"/servlet/authenticateLogin?user=\" +
user;
parent.form.action = "../servlet/authenticateLogin";
}
}
</script>
The authenticateLogin servlet (doesn't generate HTML) acts as a
traffic cop; testing the values sent to it from the JavaScript (mentioned
above), and then res.sendRedirect("html/someOtherURL").
Q: Why is it that neither of these manage to call the authenticateLogin
servlet?
parent.form.method = "POST";
parent.form.action = "../servlet/authenticateLogin";
form.method = "POST";
form.action = "../servlet/authenticateLogin";
Q: Do I need to set the <form> 'action' attribute to a literal value, null
(ie, ""), or do I need to make it a variable. If variable, then could you tell
me the exact syntax, as I can't find an example to save my life.
Thanks,
Bart
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html