hogtied
10-20-2002, 02:50 AM
Hello members,
Currently I have some infomation that is sent to a cgi script through the form's action. What ends up happening is that it loads a new page. I want to have a window that pops-up. So i thought maybe send the info to the cgi script through javascript and then do a window.open command. But I don't how to send the info to perl from java. this is what i have currently:
(A chopped up version)
<form name="frmNewsletter" method="GET" action="/cgi/newsletter.pl" onSubmit="return checkEmail()">
<input type="image" src="images/submitEmail.gif" alt="Submit" name="SubmitEmail">
<script language="JavaScript">
function checkEmail()
{
if (email == "")
{
//show error
//return to email textbox
return false;
}
else
{
if (user >= 3 && domain >= 7)
{
//process info to cgi script
//THIS IS WHERE I WOULD SEND THE INFO but don't know how and to still have it print to a file... I know i might have to change the perl script to do this. but hey whatever...
return true;
}
else
{
//show error
//return to email textbox
return false;
</script>
When I click on the submit it goes through java to validate email. If it passes then the email address is sent to a cgi script that print the email to a file. Then it goes to another page. A blank one because i haven't specified a redirect. But I don't want another page to load. I want it to be on the same page and just a pop-up that says thanks..
Any input would be appreciated.
Thanks,
Hogtied
Currently I have some infomation that is sent to a cgi script through the form's action. What ends up happening is that it loads a new page. I want to have a window that pops-up. So i thought maybe send the info to the cgi script through javascript and then do a window.open command. But I don't how to send the info to perl from java. this is what i have currently:
(A chopped up version)
<form name="frmNewsletter" method="GET" action="/cgi/newsletter.pl" onSubmit="return checkEmail()">
<input type="image" src="images/submitEmail.gif" alt="Submit" name="SubmitEmail">
<script language="JavaScript">
function checkEmail()
{
if (email == "")
{
//show error
//return to email textbox
return false;
}
else
{
if (user >= 3 && domain >= 7)
{
//process info to cgi script
//THIS IS WHERE I WOULD SEND THE INFO but don't know how and to still have it print to a file... I know i might have to change the perl script to do this. but hey whatever...
return true;
}
else
{
//show error
//return to email textbox
return false;
</script>
When I click on the submit it goes through java to validate email. If it passes then the email address is sent to a cgi script that print the email to a file. Then it goes to another page. A blank one because i haven't specified a redirect. But I don't want another page to load. I want it to be on the same page and just a pop-up that says thanks..
Any input would be appreciated.
Thanks,
Hogtied