|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome. |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
I have an order form that allows customers the option to choose products from two seperate drop down menus. Either 1 of the fields or both of the fields should be allowed to be selected. Both of them should not be required to be selected. How do I set these drop down menus up so that either one or the other, or both can be selected? I guess that both fields need to be named the same name.
Let me know if this makes sense. Below is the order form url: https://www.keysecure.com/physicians...ssproducts.htm Thanks
__________________
BohakGraphics.com |
|
|||
|
I took a look at your form, but I don't see what fields you were meaning. I got confused by your description anyway, but that's probably lack of sleep setting in. Being a new parent is such fun.
Brian.
__________________
ToolBarn.com, an Internet Retailer Top 500 and Inc. 500 Company | Tool Parts | Pet Supplies |
|
||||
|
These are the 2 fields I am referring to:
http://www.physiciansselect.com/fields.jpg The first drop down menu (located just below the text that says Herbal Weight Loss Products(see image above), allows the customer to select a product directly related to Weight Loss Supplements. In an attempt to sell them additional supplements, there is another drop down below it, named "Related Supplements". Basicly, the customer needs to be prompted if they do not select at least one product from either of these 2 drop down menus. However, it does not need to be required that they select a product from both of them. Let me know if this helps you.......to help me.
__________________
BohakGraphics.com |
|
|||
|
You'll need either JavaScript to check them when the submit button is clicked, or you'll need to handle it server side.
According to our web stats, 85% of people have JavaScript enabled on our site, so that would leave 15% of people still broken if you choose JavaScript and the same is true on your site. Server side would depend on what you're using to process the form and would require a much greater knowledge of programming, but it would work for everyone after the form post. If you want to use JavaScript, you'd need to do something similar to the following: Code:
<Script Language="JavaScript">
<!--
function validate()
{
if (page.formOrder.field1.value <> "" OR page.formOrder.field2.value <> "")
{
return true;
} else {
alert('Please select one or the other');
return false;
}
}
//-->
</Script>
Brian.
__________________
ToolBarn.com, an Internet Retailer Top 500 and Inc. 500 Company | Tool Parts | Pet Supplies |
|
||||
|
Thanks Brian,
Im going to try that. I dloaded a Dreamweaver extension at: http://www.yaromat.com/dw/?ex=Check%20Form%20MX This is very easy to use, however, for some reason the extension will not recognize the drop down menus as fields and therefore will not allow them to be checked. In other words. How do I make these drop down menus required fields? Thanks again for the advice. Im gonna try out that script, but Im pretty sure I will have the same problem. -Bohak
__________________
BohakGraphics.com |
|
|||
|
I've never tried Deamweaver. Personally, I use vi through ssh sessions, but I don't recommend this for anyone that hasn't grown up with UNIX.
The problem with any HTML generator is that it is only as good as the people who wrote it. Brian.
__________________
ToolBarn.com, an Internet Retailer Top 500 and Inc. 500 Company | Tool Parts | Pet Supplies |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |