Direct To Webpage Depending On Combobox Selection When Submit Button Clicked?
Sep 16, 2009
I've created a form with combobox with different values (this is for my website). What I want is when the user clicks 'submit' that it goes to a different page on the website depending on the value the person has selected in the combobox. Values are numerical, for example 1000, 2000, 5000 etc. I've been trying this for a couple of days now without success!
Within a classic asp webform (using vbscript) I would like part of the form (input boxes within table structure) to be specific/displayed depending on the users selection from the combo box in the row above.
I think the best solution would be using Javascript can anyone suggest a solution or example code?
I have 3 check boxes and one submit button when the submit button is hit I need it to direct to one of 3 pages depending on which check box is checked.
In the following .submit function, I am attempting to grab the value of the selected option in the facilityCodes dropdown list when I click the submit button and then during the submit function,select the facilityCode again in the dropdown list when the page reloads and then disable the list so that the user cannot change it.However,the situation is when I reload the page after the submit button is clicked the dropdown defaults to the first option and the list is enabled.I apparently am not understanding how.submit works so that I'm selecting the option I'm defining in my code below and then disabling the list AFTER the page reloads due to an error on the page. My question is how can I accomplish this?Here is my code:
$(function() { $("#ARTransferForm").submit(function() { var msgsCount = 0;[code]....
I have a submit-event attached to my form. The form contains a few different submit-buttons and I wan't to chech which one of them that triggered the submit. Shouldn't be to hard but i can't find out how to do it.
I have a drop down selection box with items in it. I need to be able to pass the selected item through using an onclick event for the "Submit" button. Is this possible?
I have a Javascript that is calling a div to popup. This div is the drop down selector. I want the user to click a button to make the drop down appear, then they must select an item in the list and then hit submit. The submit button being clicked I need to bring in the selected value from the drop down and use it in the script that originally told the div to pop up (this is the first button that the user clicks, it actually runs the script which passes 2 variables, and is basically waiting on the drop down selection to save into a 3rd variable, which will then call a PageMethod).
I have
function AddTemplateToUUT(uutnumber,testerid){ var templatename=SelectTemplateToAssign(); PageMethods.AddTemplateToUUT(testerid,uutnumber,templatename,CallbackDiv,CallbackErrorAlert,'divchecklistarea'); ShowSelection('divtemplateblock','hide');
At the bottom of this page: [URL] There's a sign up button... When you click on it, the button is disabled, and the word 'Signup' is replaced by 'Signup in process'. The HTML on the button is:
Code HTML4Strict: <button type="submit" id="SBIAgree" class="actionCreate" disableonsubmit="Signup in progress..." name="MSignal_SI-IA*">
And there is a tonne of javascript on the Fastmail Site here: [URL] I think it's something to do with the 'disableonsubmit' function, but when I tried to separate out that part of the JS into a test page myself, I can't get it to work. I wondered if anyone might be able to advise about the core JS elements that make this functionality work?
I am a novice with both asp and javascript so I may not even be doing this correctly, but I have an asp page that has variable being passed to it and I have a button that I need to have it go to one page if it is one variable and another if it was the other variable. There is only two choices but my attempts didnt work.
<p>Put in list?</p> <select name="in_list"> <option value="yes">Yes</option> <option value="no">No</option> </select>
Some PHP code governs whether the "yes" or the "no" option in either menu gets the 'default' "selected="selected" showing, based on database information. For instance, in the first menu, if the page deals with a case where the the first "is_current" value is indeed current, then the PHP code will write the default "selected="selected" for "yes":
HTML Code: <select name="is_current"> <option value=yes" selected="selected">Yes</option> <option value=no">No</option> </select>
If the page deals with a case where the value isn't current, the selected="selected" code will be written for the "no" value instead. The same goes for the second select menu. Now, the logic of my situation requires that, if the user selects "Yes" in the first "is_current" drop-down, then only "Yes" should be available to select in the second "in_list" menu. Anyway, I don't know javascript very well, but I found a function that seemed to be able to do this.
Code: <script type="text/javascript"> (function () { function updateLevel() { var limit = Number(this.value); // find the next select element var selects = this.form.getElementsByTagName('select'); var select; for (var i = 0; i < selects.length; i++) { if (selects[i] === this && selects[i+1]) { select = selects[i+1]; break; .....
(Apparently the script has to be put or called just before the </body> tag at the end of the page.) Then the select menus are recast as:
<p>Put in list?</p> <select name="in_list"> <option value="1">Yes</option> <option value="2">No</option> </select>
Now this appears to work, up to a point. If the user selects "Yes" for the first "is_current" selection, then only "Yes" becomes available for selection in the second "in_list" menu. A posted value of "1" represents "yes", and a value of "2" represents "no". Except, in Firefox, the javascript somehow overrules the default selected="selected" code. That is, the source code in the browser is correct, but the javascript draws it incorrectly.
For instance, say the database/PHP has drawn selected="selected" for the value "yes" in the second menu. Even though I can see that the source code is OK in the browser, the javascript will make the browser show a "No" selection as the initial default. This happens in Firefox, though not in Safari, and I haven't tested other browsers yet. This may be obvious but I'm not sure of javascript.
Here is my dropdown menu: <select name="peeps"> <option value="Frank Tompson">Frank Tompson</option> <option value="Henry Wilson">Henry Wilson</option> <option value="Bill Kent">Bill Kent</option> <option value="Jessi McDonald"> Jessi McDonald</option> <option value="John Hays">John Hays</option> How can I make it so if I click on John Hays a JavaScript pop up will say Hello John Hays, and if I click on Bill Kent a popup will say hello Bill Kent and if I click on any other name nothing happens?
I want a text box which is only visible if the preceding drop down box has a certain option selected. Does anyone know how to do this or where I might be able to find the appropriate code?
The code below lets a user select a drop down option and a picture changes depending on the selection. I am trying to make it so when you select an option on the dropdown the picture shows up in the center of the screen and in the background behind the text. Here is the code.
<html> <head> <style type='text/css'> #txt {background-repeat:no-repeat;width:200px;height:200px;} </style> <script type='text/javascript'> function div_bg(team){ document.getElementById('txt').style.backgroundImage="url(images/" + team + ".jpg)"; }
I have a single page which uses tabs to segment the content. Alongside the tabs themselves is a button for 'Help'. I'd like this button to open a different DIV depending upon the tab that is currently being used.For example, if I am on a tab for 'Ben', if I click the 'Help' button I want the 'helpBen' DIV to slideToggle.If I am on a tab for 'Paul', when I click the 'Help' button I want it to open the 'helpPaul' div.
Some extra needs:
1. switching to a different tab should close the currently open help div (e.g. helpBen or helpPaul)
2. There should only be one help div (e.g. helpBen or helpPaul) open at any one time.
I partly solved this with the following code but with erratic results and I'd like to know what I'm dong so wrong!Here is the HTML for the help button:
<a class="helpTrigger" href="#">Help</a>
The help DIV's are like this:
<div class="helpBen">help relevant to Ben section</div> <div class="helpPaul">help relevant to Paul section</div>
The CSS for .help is display: none; by default so none are shown from the outset.
And here is the jQuery $(".helpTrigger").click(function(){ if (location.hash == '#Ben') {[code].....
In the words of Dr Evil, "throw me a frikkin' bone here..."
how to set a variable depending on the link that is clicked than pass it to php.It's for a rating plugin - The links will be numbers 1 - 5 and need to pass the integer to php when clicked.. in background.I am assuming I would use "XMLHttpRequest" so I can reload - send variable, and display in the background.Then in php have something like $vote = GET_(vote).
I have the following code that generates two dropdown boxes in a form, but I would like for the second to be hidden unless the first has 'Software problem' selected. Is it possible to do this?
I have a big form which I'm tidying up by only showing elements when they become relevant, based on the currently selected input (eg to only show an option for 'waist size' when garment type 'jeans' has been selected). I've done this many times, and probably used a different approach each time, so I just wanted to see what other people do. It's currently along these lines: "If a particular option is selected, then show this element, otherwise hide it".
Code: //the onclick handler function checkViewType() { //go through radio inputs in the cell and check what's clicked document.getElementById('supplierOptions').style.display=radioCollection.supp.checked?"":"none"; document.getElementById('subCatOptions').style.display=radioCollection.subcat.checked?"":"none"; document.getElementById('subCatTimeOptions').style.display=radioCollection.subcat_sumtype_time.checked?"":"none"; document.getElementById('subCatSumOptions').style.display=radioCollection.subcat_sumtype_sum.checked?"":"none"; document.getElementById('subcat_weekmonth_span').innerHTML=radioCollection.subcat_time_week.checked?"week":"month"; }
But it's a big form, with lots of nested options, and some elements can be triggered visible by several different options. So I'm looking for an elegant way to handle this without a million if..elses. Perhaps an array of element ids and which elements are allowed visible when that's selected.
I want to have several text links (not buttons) on a page and when someone clicks a link text appears explaining the link. If they click on a different link the text is replaced with the new text.
I want to have a combobox with bookmark options. After you select a value from this combobox you can bookmark it with a push button. This should popup a bookmark dialog from the browser bookmark dialog.
Lets say we have 3 options in the value's. Google, Yahoo, Bing When you select Google and you push Place bookmark you should get a browser bookmark dialog with a title "Google search site". The url would be just [URL]
I also want Yahoo with the url [URL] and the bookmark title Search at Yahoo! and Bing with the url [URL] and the title Search at Bing