Results 1 to 6 of 6
Related
-
search results to be displayed in new page Forum: PHP Forum
Replies: 1 -
Passing results of script in one form to another. Forum: Javascript Forum
Replies: 0 -
required form fields in php page using redirect.php form Forum: PHP Forum
Replies: 1 -
Form Results Processing Forum: Website Scripts Forum
Replies: 2 -
overwrite results on submit form Forum: HTML Forum
Replies: 5
-
08-16-2007, 03:03 PM #1
How to use Form Results within same page
I want to have a form at the top of my webpage that prompts the visitor to enter in their first name, last name and choose gender from a drop down box. I know how to create the form. What I don't know how to do is, 'how do I use the visitor's input info (results) in the text below the form?' I know it must be an easy task but I am a pre-novice. Thanks in advance for your help.
-
08-17-2007, 08:37 PM #2
Re: How to use Form Results within same page
Let me see if I follow you correctly.
You want to create a message at the bottom of the html page with the value of the first name text box, last name and the gender of the drop down.
ok do this...
HTML Code:<HTML> <HEAD> <SCRIPT LANGUAGE="javascript"> function CreateMsg() { var MsgDOM = document.getElementById("MSG"); MsgDOM.innerHTML = "Hello, " + document.forms[0].FNAME.value + " " + document.forms[0].LNAME.value + ". You're sex is " + document.forms[0].GENDER.value; } </SCRIPT> </HEAD> <BODY> <FORM NAME="DUH"> <INPUT TYPE=TEXT NAME=FNAME> <INPUT TYPE=TEXT NAME=LNAME> <SELECT NAME="GENDER"> <OPTION VALUE="Male">Male</OPTION> <OPTION VALUE="Female">Female</OPTION> </SELECT> <BR><BR> <A HREF="javascript:CreateMsg();">Create Message</A> <BR><BR> <SPAN ID="MSG"> </SPAN> </FORM> </BODY> </HTML>
CHANGE: I have tested this, and it works.Last edited by mschutte; 08-17-2007 at 08:40 PM.
-
08-20-2007, 08:41 AM #3
Re: How to use Form Results within same page
That is exactly what I want. One more question though. How do I eliminate the gender part. I've decided that I don't need that part.
What I ultimately want to accomplish is, after they've entered their first and last names, further down in the text, I want the following
to appear as personal affirmations.
Michael Murphy possesses personal power now.
Michael, you can be, do and have anything your heart desires.
Michael Murphy is designed for awesome accomplishment, engineered
for amazing success and empowered with the seeds of greatness.
Michael, you possess the power to choose your destiny now.
Thank you so much.
Michael MurphyLast edited by murphy903; 08-20-2007 at 08:54 AM.
-
08-20-2007, 10:46 AM #4
Re: How to use Form Results within same page
Murphy,
that should be a simple change. Take a look at the CreateMsg() function and modify it just how you want it.
-
08-23-2007, 03:22 PM #5
Re: How to use Form Results within same page
To help you out I have changed the code so that the gender part is no longer there:
Code:<HTML> <HEAD> <SCRIPT LANGUAGE="javascript"> function CreateMsg() { var MsgDOM = document.getElementById("MSG"); MsgDOM.innerHTML = "Hello, " + document.forms[0].FNAME.value + " " + document.forms[0].LNAME.value; } </SCRIPT> </HEAD> <BODY> <FORM NAME="DUH"> <INPUT TYPE=TEXT NAME=FNAME> <INPUT TYPE=TEXT NAME=LNAME> <BR><BR> <A HREF="javascript:CreateMsg();">Create Message</A> <BR><BR> <SPAN ID="MSG"> </SPAN> </FORM> </BODY> </HTML>
-
02-17-2010, 03:45 PM #6
Form as part of a hyperlink
This is very helpful. I have a slightly different task I'm trying to accomplish. How do I get the results of a form to be part of a hyperlink.
enter username: "sample" (user enters sample into form)
then press (enter,input,go to, etc)
sends them to http://www.howto.com/sample
where "sample" is the result of the form
Cloudjiffy- PaaS for Developers
10-05-2020, 12:30 AM in Web Hosting Forum