Click to See Complete Forum and Search --> : Request.Form() JavaScript equivalent??


the_idiot
05-01-2003, 03:16 AM
I am building a site with form-based email that includes the following input:

1. name
2. email
3. message

When the form is submitted the user is redirected to an email confirmation page that I would like to have display the information which the user entered.

I can do this with ASP or Cold Fusion, but my client's webhost does not support either.

I was hoping that there was a way to do this with JavaScript. I took a wild stab at it based on the little bit of JS that I know and included the follwing script on the confirmation page:

<script language="JavaScript">
document.write(Request.Form(name));
</script>

I was hoping that since Request.Form() was a vaild method when coding JScript in ASP that it could be used in JavaScript as well.

I also tried

<script language="JavaScript">
document.write(form.name.value);
</script>


Of course, these scripts would need to be repeated for the email and message form elements.

I am very new to webdev and especially JavaScript so any info would be of great help.

thanks

beebob
05-01-2003, 03:20 AM
do you just want to be redirected and/or move the data by javascript?

the_idiot
05-01-2003, 02:14 PM
Thanks for the quick responses.

Dave--

I will have a look at the information you posted. Much appreciated.


Beebob--

Redirect is handled by CGI and works OK, I just want to be able to display form contents on the redirect (confiramtion) page.


thanks again

the_idiot
05-01-2003, 02:42 PM
I looked at the source code for passing the form info and, if I understand correctly, it appears that the action "send_mypage.html" excludes sending the form to a CGI script for processing.

I guess I'll just leave the confirmation page static, unless there is some other way to pass/request the form elements without ASP, JSP, or Cold Fusion.

the_idiot
05-01-2003, 07:41 PM
"The same thing can be done through CGI -- no client-side JavaScript required."

This is good news, but how can I do it without the JavaScript?

How can I make a request for the data?

I am using the host's formail.pl script, which I assume is perl.

Probably going to reveal my extreme lack of knowledge here, but... do I need to edit the script to tell it to pass the data to the confirm page?

thanks for following up on this thread

the_idiot
05-02-2003, 03:21 AM
Originally posted by Dave Clark
When working with someone else's pre-written script, it is going to be impossible -- or, at least, extremely hard :D -- to get it to do something that it was not written to do.

That's what I was afraid of.

Originally posted by Dave Clark
I've used FORMMAIL before, but I don't think it supports using your own confirmation page.


Actually, when testing on the server, the redirect worked fine. Just added a hidden field named "redirect" to the form.

All I wanted to do was have the information from the form page displayed on the redirect page, as a way for the user to double check their input.

For now, I'll just have the static confirmation message. I am setting up a shopping cart for the site as well, so when that is done my client will have to switch to a different host and I can do the form query in CF.

thanks for all the help

the_idiot
05-02-2003, 12:51 PM
That script has no provision for passing the data through to the "thank-you" page.


Well now, that is the aggrevating part. The default thank-you page did display the form text, so the capability must be built into the script. I tried to view the source of the default confiramtion page, but it was not much help.

I suppose I could go in and look at the script, to see if I can make out which function passes the data, but I don't know Perl and would feel uneasy changing anything.

the_idiot
05-02-2003, 06:05 PM
I will check out the CGI forum.

Thanks for taking time to answer my questions.