"Simple" Form Question ...

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
jmueller0823
Forum Commoner
Posts: 37
Joined: Tue Apr 20, 2004 9:06 pm

"Simple" Form Question ...

Post by jmueller0823 »

We are passing a value (an email address) to a form like so:

http://www.site.com/form.htm?email=email@email.com

...The value passes successfully.

We would like to display that value on the page.
I thought something like this might work:

<script langauge="JavaScript">
document.write(document.forms.myForm.email.value);
</script>

...But it does not display. Ideas?

We could of course show the value in an email field,
but we prefer not to show a form field.

Thanks!
User avatar
tasteslikepurple
Forum Commoner
Posts: 46
Joined: Thu Jan 26, 2006 3:38 am
Location: Bath, UK

Post by tasteslikepurple »

you could do:

Code: Select all

<?php
echo $_GET["email"];
?>
and that will print out the value of the email variable.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Re: "Simple" Form Question ...

Post by s.dot »

jmueller0823 wrote:We are passing a value (an email address) to a form like so:

http://www.site.com/form.htm?email=email@email.com

...The value passes successfully.

We would like to display that value on the page.
I thought something like this might work:

<script langauge="JavaScript">
document.write(document.forms.myForm.email.value);
</script>

...But it does not display. Ideas?

We could of course show the value in an email field,
but we prefer not to show a form field.

Thanks!
Perhaps it should be

Code: Select all

<script type="text/javascript">
document.write(document.myForm.email.value);
</script>
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Code: Select all

document.forms['myForm'].elements['email'].value
Post Reply