See
http://www.irt.org/script/1046.htm
|I have been reading this exchange and it has helped me a lot with a similar
| problem I have. I have one extra requirement, though. When the selection is
| made, is it possible to select the option value from a drop down list?
|
| This is an application for make-up classes in an acting school.
|
| For example, if a student selects IMPROVISATION as the class they want to
| make-up, then the value should show all the dates on which this class is
| available, preferably from a drop down list.
|
| Is that possible?
|
| Thank you in advance for your answer!
|
| Laura
|
| "Stefan B Rusynko" wrote:
|
| > OK
| >
| > You apparently don't need the 3 functions (deleteOption, addOption, replaceOption) and the 3 buttons (Delete, Add, Replace) and
can
| > delete all of them. Just add a submit button (and if desired a reset button)
| >
| > And don't delete the field, just make it hidden field so it won't show by making it: type="hidden"
| > <input name="text1" type="hidden" value="">
| >
| > That way the sample form will send
| > Select1 "0"
| > Text1 "Apples"
| > Value1 "$1.00"
| >
| > Where Text1 is the "option text" selected in the dropdown (your item for sale)
| > And Value1 is the price of the item for sale selected
| >
| > If you don't want the value of the field Select1 ("0") to be sent, just remove it from your form properties saved fields (select
the
| > form and right click for Form Properties Options Saved Fields All fields- and then delete it)
| >
| > The first form field (named select1) uses the onchange event to change the values of other 2 fields in the form (named text1 and
| > value1 respectively in the original code) by using the onchange function in the head section. - Those are the real values you
want
| > to pass in your submit
| >
| > In the simplest form just paste the below code in a new page in your FP site
| > (say emailing the form results to you using your fruit sale example - with fields renamed and some validation)
| >
| > <html><head><title>Fruit Sales</title>
| > <script language="JavaScript"><!--
| > function onChange(fRef, sName, tName, vName) {
| > var i = fRef[sName].selectedIndex;
| > fRef[tName].value = fRef[sName].options
.text;
| > fRef[vName].value = fRef[sName].options.value;
| > } //--></script>
| > </head><body>
| > <form action="--WEBBOT-SELF--" method="POST">
| > <!--webbot bot="SaveResults" S-Email-Format="TEXT/PRE" S-Email-Address="(e-mail address removed)" B-Email-Label-Fields="TRUE"
| > S-Builtin-Fields S-Form-Fields="ItemName ItemPrice " -->
| > Item: <!--webbot bot="Validation" s-display-name="Select an Item" b-value-required="TRUE" -->
| > <select name="ItemList" onchange="onChange(this.form, 'ItemList', 'ItemName', 'ItemPrice')" size="1" tabindex="1">
| > <option value="0.50">Oranges</option>
| > <option value="1.75">Peaches</option>
| > <option value="2.00">Plums</option>
| > <option value="1.00">Apples</option>
| > <option value="2.00">Cherries</option>
| > <option value="3.25">Kiwi</option>
| > </select><input name="ItemName" type="hidden" value tabindex="3">
| > Price:<input name="ItemPrice" type="text" value size="4" onClick="this.blur();" tabindex="4">
| > <input type="submit" value="Submit" tabindex="2">
| > </form></body></html>
| >
| > Selecting Plums will just send
| >
| > ItemName: Plums
| > ItemPrice: 2.00
| >
| > Email me directly w/ any questions if you need to
| > --
| >
| > _____________________________________________
| > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > "Warning - Using the F1 Key will not break anything!" (-;
| > To find the best Newsgroup for FrontPage support see:
| > http://www.net-sites.com/sitebuilder/newsgroups.asp
| > _____________________________________________
| >
| >
| > | When I delete the line of code that displays the "text" I don't get the text
| > | in the submitted form (and I need it).
| > |
| > | Example: Pull down value (select1) "Apples"
| > | Text1 "Apples"
| > | Value1 "$1.00"
| > |
| > | But the submitted form yeilds:
| > | Select 1 "0"
| > | Text1 "Apples"
| > | Value1 "$1.00"
| > |
| > | So if I don't display the...
| > |
| > | You know what... This process isn't working for me..
| > |
| > | I've spent 4 hours screwing around with what should have been a 5 minute fix.
| > | SBR if you know how to make this work with a submit button (there wasn't
| > | one), no
| > | "delete", "add","Replace" buttons (I don't want them) call me at (925)551-0162
| > | and ask for Jon. I'll pay you $100 for 5-10 minutes of your time. (I hope
| > | you take credit cards)
| > |
| > | -Thanks
| > |
| > | "Stefan B Rusynko" wrote:
| > |
| > | > Just delete the line of code displaying the option selected
| > | > <input name="text1" type="text" value=""> - text
| > | >
| > | > - but then you can't use the add or replace buttons in that script which need it
| > | >
| > | >
| > | > --
| > | >
| > | > _____________________________________________
| > | > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > | > "Warning - Using the F1 Key will not break anything!" (-;
| > | > To find the best Newsgroup for FrontPage support see:
| > | > http://www.net-sites.com/sitebuilder/newsgroups.asp
| > | > _____________________________________________
| > | >
| > | >
| > | > | Wow that's a great little nuggett of code.
| > | > | Thank you very much.
| > | > | I've been modifing it and find it's very flexable.
| > | > | Is there a way to get it to hold a text value in "select1" (the choice), and
| > | > | hold the numeric value in "value1" when the form is submitted (and not
| > | > | display the "text1" on the form at all?)
| > | > |
| > | > | I've got it working but I'm displaying the selection text twice on the form
| > | > | in order to get it into the submitted data once.
| > | > |
| > | > |
| > | > | -Thanks again
| > | > |
| > | > | "Stefan B Rusynko" wrote:
| > | > |
| > | > | > For the JavaScript code View source at
| > | > | > http://www.irt.org/instant/chapter8/dynamic/single.htm
| > | > | >
| > | > | > --
| > | > | >
| > | > | > _____________________________________________
| > | > | > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > | > | > "Warning - Using the F1 Key will not break anything!" (-;
| > | > | > To find the best Newsgroup for FrontPage support see:
| > | > | > http://www.net-sites.com/sitebuilder/newsgroups.asp
| > | > | > _____________________________________________
| > | > | >
| > | > | >
| > | > | > |I have a client who wants a form where upon selection of a choice from a pull
| > | > | > | down, the field below it populates with a price.
| > | > | > |
| > | > | > | I know several ways to include the price within the pull down display and
| > | > | > | the post but they want it displayed AFTER the pulldown selection, and in a
| > | > | > | second field.
| > | > | > |
| > | > | > | Any simple methods??
| > | > | >
| > | > | >
| > | > | >
| > | >
| > | >
| > | >
| >
| >
| >