/    Sign up×
Community /Pin to ProfileBookmark

2 button Input /Output form HELP!!!!!!!!!!!!

Example of what it looks like:
[url]http://img476.imageshack.us/img476/3783/129pb.png[/url]

I can get it to return the correct answer in the first box but not in the second button box.
Please help:

code:
<html>
<head>
<title>Questionnaire Page</title>
<script type=”text/javascript”>
/*The first funtion will (supposedly) take the surfer’s answer to the ice cream question,
e.g., “Mint chocalate chip”, and display “Mint Choclate chip is my favorite too!” in the messageBox.
The second function will (suposedly)take the surfer’s answer to the movie
question and display Titantic huh? I prefer the Marx Brothers.”*
/
function printGreeting(){
document.question1.outputBox.value=
document.question1.icecreamBox.value + ” is my favorite too!”}

function printGreeting2(){
document.question2.outputBox.value=
document.question2.movieBox.value +” huh? I prefer the Marx Brothers.”}

</script>
</head>
<body>
<form id=”question1″ name=”question1″>
Please enter your favorite flavor of ice cream, then click the button:<br/>
<input type=”text”name=”icecreamBox”
size=”30″ /
</br>
<input type=”button”name=”b1″
value=”Click!” onclick=”printGreeting()”/>
</br>
<input type=”text” name=”outputBox”
size=”30″/>

<form id =”question1″ name”question1″>

Please enter your favorite movie of all time, then click the button:<br/>
<input type=”text” name= “movieBox”
size=”30″/
</br>
<input type=”button”name=”b1″
value=”Click!”onclick=”printGreeting2()”/>
<br/>
<input type=”text” name=”outputBox”
size=”30″/>

</form>
</body>
</html>

THanks in advance
Gina
Edit/Delete Message ?

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@Mr_JNov 23.2005 — Please try the following


[code=php]<html>
<head>
<title>Questionnaire Page</title>
<script type="text/javascript">
/*The first funtion will (supposedly) take the surfer's answer to the ice cream question,
e.g., "Mint chocalate chip", and display "Mint Choclate chip is my favorite too!" in the messageBox.
The second function will (suposedly)take the surfer's answer to the movie
question and display Titantic huh? I prefer the Marx Brothers."*/

function printGreeting(){
document.forms["questions"]["outputBox1"].value=document.forms["questions"]["icecreamBox"].value + " is my favorite too!"
}

function printGreeting2(){
document.forms["questions"]["outputBox2"].value=document.forms["questions"]["movieBox"].value +" huh? I prefer the Marx Brothers."
}

</script>
</head>
<body>
<form name="questions">
Please enter your favorite flavor of ice cream, then click the button:<br/>
<input type="text"name="icecreamBox" size="30" /></br>
<input type="button"name="b1" value="Click!" onclick="printGreeting()"/></br>
<input type="text" name="outputBox1" size="30"/>

Please enter your favorite movie of all time, then click the button:<br/>
<input type="text" name= "movieBox" size="30"/></br>
<input type="button"name="b1" value="Click!"onclick="printGreeting2()"/><br/>
<input type="text" name="outputBox2" size="30"/>
</form>

</body>
</html>

[/code]
Copy linkTweet thisAlerts:
@gina4unccauthorNov 23.2005 — THAT DID IT ? with the addition of a <br/> and common and > around <html>

GREAT...thank you bunches? :p
×

Success!

Help @gina4uncc spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...