Form Options
Feb 21, 2007
Does anyone know how to get the value from a form option (dropdown list) and have it post the value without having a submit button?
So that when I choose a value in the option list the page is automatically reloaded with that value?
View 6 Replies
ADVERTISEMENT
Jan 12, 2008
I am helping someone out with a form. He wants the name required, easy enough, but then only an email or street address required. I have tried a couple of things and it is not working.
I am trying a very simple code:
<script type="text/javascript">
<!--
function validate_form ( )
{
valid = true;
if ( document.contact_form.name_mailing.value == "" )
{
alert ( "Please fill in the 'Your Name' box." );
valid = false;
}
if ( document.contact_form.address_mailing.value == "" || document.contact_form.email_address.value == "")
{
alert ( "Please fill in the 'Your Information' box." );
valid = false;
}
return valid;
}
//-->
</script>
Am I not using the or operator correctly? I only want to have the address or email required, not necessarily both.
View 2 Replies
View Related
Aug 16, 2011
I google'd myself silly, I can't find tutorials for this. I hope someone could lend me a hand.
I'll try to make this simple. I have a PHP & MySQL driven site. I have a form for adding new content.
The form has a set of check box options that are pulled from MySQL.
At the bottom of the check boxes there is an "Add New" input field which I want to be used to add new check box options right above it.
database
So as I understand how this should work, when I click in the 'add new' text field, type something in, then press enter - the value of the add new field should be sent to a php script, addnew_backend.php. The form itself should not submit it's data. The PHP script will add the new value to the mysql table of options, and if successful, returns the newley generated checkbox which should fade in right above the add new text field into div#newoptions.
addnew_backend.php
View 9 Replies
View Related
Dec 30, 2009
I have a form for the registration of a event for our club. Now I want this. If the check box groep is not selected there is a fieldset individu_km. If I select the check box groep this one must hide and the fieldset groep_km must be showed. This is the code i have now already found and changed.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
[Code]....
To hide the fieldset groep_km works only the fieldset individu_km won't hide.
View 1 Replies
View Related
Apr 26, 2009
I'm not sure if my term usage is correct, but using a select form field with various options. I would like that when an option is selected, a php query is performed, and the rest of the form is updated according to the selection based query.
View 2 Replies
View Related
May 15, 2010
how to fix the coding so when a user select a category it will add a different hidden filed for that option for example: When the user selects category "Men" the hidden filed
Code:
<INPUT TYPE="HIDDEN" NAME="REFERRER" VALUE="http://men.com/acatalog/">
automaticly will be added the search
and when the user selects category "Kids" the hidden filed
Code:
<INPUT TYPE="HIDDEN" NAME="REFERRER" VALUE="http://kids.com/acatalog/">
automaticly will be added the search[code]......
how do I make the "Select Catagory" a Must Choose and if not chosen to give message that say"Please Select a Category"
View 2 Replies
View Related
Apr 3, 2011
I have a page that runs a lot of calculations.The math is computed on the fly using java scriptwhen all the calcs are in, prior to form submission the user needs to evaluate which numbers they prefer, and from there, once they select them, the form, based on those choices, will perform one last calclets say we have 3 result fields
r1 = 2000
r2 = 3000
r3 = 4000
what i want to do is have a select field be able to display those values at the bottom of the page;for example
<select name="s1">
<option value=[field contents of r1 above]>[field contents of r1 above]</option>
<option value=[field contents of r2 above]>[field contents of r2 above]</option>
[code]....
View 10 Replies
View Related
Jan 30, 2010
I want to add more dropdown options which are dependent on previous options. Now I have "hand" and "loft". I want to add next option "model" How to add third dropdown option box?
Here is the code:
View 3 Replies
View Related
Jul 22, 2009
I have been searching for hours and have not found what I am looking for. BUT, I have seen it before when I was NOT looking for it. haha!
Anyway, I am creating a form. And the form has an element that asks for "How Many Children?" followed by a dropdown from 1 to 6.
Well I would like to display another set of elements from 1 time to 6 times, based on their selection.
Name: ___ Age: ____ Sex:____
That will be displayed as many times as the user selects.
View 4 Replies
View Related
Feb 2, 2010
I'm trying to make a function that will disable elements of a form based on which options are selected.
I have made this work for individual form controls but now i want to make it into a function that could be used on any form control.
Here is the broken function
Code:
I've probably just missed something but i really cant see what?
View 9 Replies
View Related
Sep 4, 2009
Okay, I'm having some trouble getting my head around how to do this..
<select>
<option value="A">A</option>
<option value="B">B</option>
[code]....
View 1 Replies
View Related
Nov 17, 2007
i currently have a few problems with my code, but currently i want to get my options into my function
<select id="menu">
<option value="first">First Time User</option>
<option value="Frequent">Frequent Flier</option>
<option value="Buying">Buying a Degree</option>
</select>
How do I use this info to make it part of my function, for example when First Time user is selected and the function is executed it i want a windows.alert to come up but i don't know how to code that.
View 2 Replies
View Related
May 7, 2001
I have a bit of a question about CGI...I'm not very knowledgeable about it, so I have a specific question. Can you set up a site in which sites can be rated using CGI?
View 2 Replies
View Related
Feb 3, 2006
I would like to allow users to print a page, but I want to suppress the
header and footer the appear by default. Are there options to permit this?
View 2 Replies
View Related
Jan 11, 2007
I've tried to access the value of a selected option through the
following getSelectValue function, passing the name of the select
function getSelectValue (name) {
var sel = document.getElementsByName(name)[0];
var i = sel.options.selectedIndex;
return i == -1? "": sel.options[i].value;
}
getSelectValue ('belongsto')
...
<select name="belongsto" ...
yet I always get the error "sel has no properties". Any idea what's
wrong? Is there a simpler way?
View 4 Replies
View Related
Apr 21, 2006
I have an some options like this:
<option value="12345" title="Frank">Frank - 12345</option>
What I want to do, is get the title. I've tried this:
document.MyForm.MySelect.options[document.MyForm.MySelect.selectedIndex].title
That dosn't work. I'm just using the title attribute as a place to hold the information I need. Maybe there is another attribute that would work better for this? How can I get the contents of the attribute?
View 7 Replies
View Related
Jan 26, 2004
Code:
<script>
alert("You are not allowed to see this page");
self.location="javascript:history.go(-1)";
</script>
The above script has one option.
I like to make two options(yes or no) like the following.
Code:
<script>
alert("Are you sure to delete?");
Yes(self.location="delete.php");
No(self.location="javascript:history.go(-1))";
</script>
Is it possible? How?
View 2 Replies
View Related
Jun 3, 2005
I have one select, I can say wich element is selected:
<select name="myselect">
<option value="100">A</option>
<option value="101">B</option>
<option value="102">C</option>
</select>
this line will select the option B
myselect.options.selectedIndex = 1;
but, how can I do if I want to select the option B without knowing it´s position?
I mean, I want to select the option B and the value 101, but I don´t know it´s position
any idea?
View 3 Replies
View Related
Jul 23, 2005
Using IE5.5+, is it possible to hide options in a select?
The following doesn't work:
<HTML>
<HEAD>
<STYLE>
SELECT OPTION.orgA{ display:none }
.orgB{ display:inline }
.orgC{ display:none }
</STYLE>
</HEAD>
<BODY>
<SELECT id=cbo size=3>
<OPTION class="orgA">RTI</OPTION>
<OPTION class="orgB">LAB</OPTION>
<OPTION class="orgC">TCI</OPTION>
</SELECT>
</BODY>
</HTML>
View 1 Replies
View Related
Jul 23, 2005
I have a drop down with alot of options say about 6000 cities and
districts. I need to select all options if user selects "All checkbox".
I use "on change" and a for loop to do this, but it takes a lot of time
to select all these options. Is there any faster way to select all
these options?
function selectAll()
{
var element = document.getElementById("location");
var length = document.getElementById("location").length;
for(var i=0; i<length; i++)
{
element.options[i].selected=true;
}
}
View 3 Replies
View Related
Jul 23, 2005
I have two drop down box's in a form, how would I go about changing the
options of the seccond one depending on what option is selected in the
first one?
For example, if there's a drop down box with "a", "b" and "c" as the
options, and another drop down box with "1", "2" and "3" as the
options; then when you select "a" on the first drop down box the values
of the seccond one changes to "a1", "a2" and "a3". This should work for
all the options of the first drop down box.
View 3 Replies
View Related
Jun 1, 2006
In JS, how can I change the selected value of a dropdownlist(select options)
I know the value of indexed value of the selected value before it is changed.
View 4 Replies
View Related
Aug 3, 2006
I got this simmple function, It stays on onChange on select and on
change it hides all objects with ID equal to select name plus the
optionvalue. It works perfectly in Opera and FF, but IE crashes because
says that options object is null
the problem is in for (optionId in what.options)
It seems that IE does NOT return the list of options, but only some
other objects: language scrollheight, istextedit, currentstyle,
document, and onmouseup
Please can you help me how can I go throuth that cycle? I need to get
the values of all options in select. Thank you
function showHide (what) {
selectedId=what.options.selectedIndex;
selectedValue=what.options[selectedId].value;
selectedObject = document.getElementById(what.name+selectedValue);
selectedObject.className="";
for (optionId in what.options)
{
optionValue=what.options[optionId].value;
if (optionValue) {
optionObject = document.getElementById(what.name+optionValue);
if (optionId!=selectedId) {
optionObject.className="hidden";
}
}
}
}
View 3 Replies
View Related
Aug 31, 2006
I have 4 select fields like;
<select id="choice_101" name="choice_101">
<option label="Will not attend" value="Will not attend"
selected="selected">Will not attend</option>
<option label="First Choice" value="First Choice">First
Choice</option>
<option label="Second Choice" value="Second Choice">Second
Choice</option>
<option label="Third Choice" value="Third Choice">Third
Choice</option>
<option label="Fourth Choice" value="Fourth Choice">Fourth
Choice</option>
</select>
choice_102, choice_103 and choice_104
The user must bem select options in this 4 files in order, for example,
he must bem select first "First Choice" next "Second Choice"... The
options not be same.
View 1 Replies
View Related
Oct 14, 2006
I notice when I view the source of a lot of Google pages (for example,
my GMail Inbox page source) that the src option in <scripttags will
refer to addresses like "?foo=bar&bla=bla". How does this work
exactly? Does the server side script return a string containing
javascript code? How does it know which server side script to call?
Does it look for an index file of some type?
Something else I just noticed in the address of this page (I know this
is off topic, sorry)... this page sends GET data to a "place" named
'post', but 'post' has no file extension. How does this work?
View 1 Replies
View Related
Mar 11, 2009
I'm working on a small scrolling popup window that mimicks an instant message window. I've currently got it all set up and working however I would like a way to have multiple var html_code options that can be picked at random. For example, each option would have a different image and text in the box.
Here's the header code...
View 2 Replies
View Related