Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
A simple question, or so I thought
Old 02-09-2010, 10:21 PM A simple question, or so I thought
Junior Talker

Posts: 3
Name: Glenn
Trades: 0
I wanted to use a form drop down so users could input to change the result of say a sentence. Kinda like Mad Libs. I have read lots of tutorials on forms and they all talk about email notifications and what not, I simply want the value of the text or drop down box to display in a sentence.

Example:



sorry the picture looked better when I made it, but you get the idea. I assume it needs some sort of tag or something, or maybe java to make it work.
popems123 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-10-2010, 06:05 AM Re: A simple question, or so I thought
Experienced Talker

Posts: 43
Trades: 0
This cant be achieved with only html, you need javascript/php/asp something like that.

Try searching for php/javascript forms and you will find soon enough example's of what you are trying to create.
TheSir is offline
Reply With Quote
View Public Profile
 
Old 02-10-2010, 11:21 AM Re: A simple question, or so I thought
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Just the kind of silly bit of programming I like to do just for fun.

HTML Code:
<select id="s1" onchange="document.getElementById('word1').innerHTML = this.value;" >
<option value="One">One</option>
<option value="Two">Two</option>
<option value="Three">Three</option>
<option value="Four">Four</option>
<option value="Five">Five</option>
<option value="Six">Six</option>
<option value="Seven">Seven</option>
<option value="Eight">Eight</option>
<option value="Nine">Nine</option>
<option value="Ten">Ten</option>
</select>
<select id="s1" onchange="document.getElementById('word2').innerHTML = this.value;" >
<option value="Red">Red</option>
<option value="Green">Green</option>
<option value="Blue">Blue</option>
<option value="Orange">Orange</option>
<option value="Yellow">Yellow</option>
<option value="Brown">Brown</option>
<option value="Black">Black</option>
<option value="White">White</option>
<option value="Purple">Purple</option>
<option value="Mauve">Mauve</option>
</select>
<select id="s3" onchange="document.getElementById('animal').innerHTML = this.value;" >
<option value="Horse">Horse</option>
<option value="Frog">Frog</option>
<option value="Cat">Cat</option>
<option value="Dog">Dog</option>
<option value="Elephant">Elephant</option>
<option value="Horse">Horse</option>
<option value="Camel">Camel</option>
<option value="Newt">Newt</option>
<option value="Lion">Lion</option>
<option value="Salamander">Salamander</option>
</select>
<div id="sentence">Behind door <span id="word1">??????</span> there lives a <span id="word2">??????</span>   <span id ="animal">??????</span>! </div>
demo at http://www.modtalk.co.uk/_site/code/...ord-selectors/
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 02-10-2010, 10:44 PM Re: A simple question, or so I thought
Junior Talker

Posts: 3
Name: Glenn
Trades: 0
Thanks to "TheSir" for your reply to point me in the right direction. I have only just started working with web sites for about 6 months & still have lots to learn.
popems123 is offline
Reply With Quote
View Public Profile
 
Old 02-10-2010, 11:04 PM Re: A simple question, or so I thought
Junior Talker

Posts: 3
Name: Glenn
Trades: 0
Chrishirst you Rock!! that's exactly what I was looking for. I pasted the code it into FrontPage and it works perfect. I have been searching for a couple of months for an answer. Should have joined webmaster-talk along time ago.


p.s. Thanks for putting my post where it belongs.
popems123 is offline
Reply With Quote
View Public Profile
 
Old 02-16-2010, 05:12 PM Re: A simple question, or so I thought
Novice Talker

Posts: 14
Trades: 0
Chrishirst thanks for sharing very useful information. I have been searching for this script similar to this one for quite sometime. I think i found what i was looking for.
__________________

Please login or register to view this content. Registration is FREE
sajan1kota is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to A simple question, or so I thought
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.01385 seconds with 12 queries