Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-10-2012, 06:30 PM   PM User | #1
ammweb
New Coder

 
Join Date: Jun 2008
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
ammweb is an unknown quantity at this point
Submit button or Address Form

On a form, depending on what they select will depend on if an address form appears or just a submission button. There are five possible choices. If two of them are selected it will produce an address form for them to fill out, If any of the other three, it will just provide a submit button. What is the best way to set this up?

If they select 1 then address form
If they select 1 & 2 then address form
If they select 1, 2, 3, 4, or 5 then submit button
If they select 3, 4, or 5 then submit button

It is not a select list, these are all separate.
The first choice is a checkbox fields, second choice is a textarea,
If they select either or both of these--I want an include file with address info to appear, along with the submit button,

The third, fourth and fifth choices are dropdown list and radion buttons with money values, if they select any of these, I don't want the include file with the address info to come up and only a submit button would be available.

Does this make more sense?

Last edited by ammweb; 12-10-2012 at 07:18 PM..
ammweb is offline   Reply With Quote
Old 12-10-2012, 06:37 PM   PM User | #2
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,100
Thanks: 197
Thanked 2,421 Times in 2,399 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
Quote:
Originally Posted by ammweb View Post
On a form, depending on what they select will depend on if an address form appears or just a submission button. There are five possible choices. If two of them are selected it will produce an address form for them to fill out, If any of the other three, it will just provide a submit button. What is the best way to set this up?

If they select 1 then address form
If they select 1 & 2 then address form
If they select 1, 2, 3, 4, or 5 then submit button
If they select 3, 4, or 5 then submit button
Sorry, I don't understand.

Are you talking about a <select> list with select multiple? select 1 & 2?

If user selects 1 do they see both the address form and the submit button?
__________________

All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.
Philip M is offline   Reply With Quote
Old 12-10-2012, 07:19 PM   PM User | #3
ammweb
New Coder

 
Join Date: Jun 2008
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
ammweb is an unknown quantity at this point
It is not a select list, these are all separate.
The first choice is a checkbox fields, second choice is a textarea,
If they select either or both of these--I want an include file with address info to appear, along with the submit button,

The third, fourth and fifth choices are dropdown list and radion buttons with money values, if they select any of these, I don't want the include file with the address info to come up and only a submit button would be available.

Does this make more sense?
ammweb is offline   Reply With Quote
Old 12-10-2012, 07:20 PM   PM User | #4
ammweb
New Coder

 
Join Date: Jun 2008
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
ammweb is an unknown quantity at this point
It is not a select list, these are all separate.
The first choice is a checkbox fields, second choice is a textarea,
If they select either or both of these--I want an include file with address info to appear, along with the submit button,

The third, fourth and fifth choices are dropdown list and radion buttons with money values, if they select any of these, I don't want the include file with the address info to come up and only a submit button would be available.

Does this make more sense?
ammweb is offline   Reply With Quote
Old 12-10-2012, 09:32 PM   PM User | #5
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,100
Thanks: 197
Thanked 2,421 Times in 2,399 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
Quote:
Originally Posted by ammweb View Post
It is not a select list, these are all separate.
The first choice is a checkbox fields, second choice is a textarea,
If they select either or both of these--I want an include file with address info to appear, along with the submit button,

The third, fourth and fifth choices are dropdown list and radion buttons with money values, if they select any of these, I don't want the include file with the address info to come up and only a submit button would be available.

Does this make more sense?
Only marginally. I don't know how you "select" a textarea.

Place the elements which you want to hide/show within a <div> set initially to style="display:none"

Then get the values of the form elements you mention. Perhaps onchange.

Show/hide the divs as required using style.display="block"; or style.display="none";
according to the combination(s) of form element values.

As you don't show your HTML that is the best I can do.
__________________

All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.
Philip M is offline   Reply With Quote
Old 12-10-2012, 10:58 PM   PM User | #6
ammweb
New Coder

 
Join Date: Jun 2008
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
ammweb is an unknown quantity at this point
Here is the link page that I am working with:
http://www.amm.org/PrayWithUs/decrempt.aspx?

At the bottom you will see, it features Your Name and Address info.
I don't want this to show up on this page, unless the person checks only the check boxes under My Intentions and/or fills in text under Special Intentions at the top of the page.

So if the person fill out the check box and nothing else, I want the Address Info to show up at the bottom,
BUT if
a person checks the check box and also selects a dropdown box under "Votive Light Offering" or selects a radio button under "I wish to make a donation" I don't want the Address Info to show up--just the submit button.

Does this make more sense?

Thanks for your patience!
ammweb is offline   Reply With Quote
Old 12-11-2012, 10:33 AM   PM User | #7
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,100
Thanks: 197
Thanked 2,421 Times in 2,399 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
You did not mention that your page is using jQuery. Ask a mod to move this thread to the right forum.

It looks to me that your site was written by a professional. Why have you not requested him to make this change?
__________________

All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.

Last edited by Philip M; 12-11-2012 at 10:36 AM..
Philip M is offline   Reply With Quote
Old 12-11-2012, 02:04 PM   PM User | #8
ammweb
New Coder

 
Join Date: Jun 2008
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
ammweb is an unknown quantity at this point
It is using an Iframe, but within the Iframe is an asp page which is what I develop.
ammweb is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 10:32 PM.


Advertisement
Log in to turn off these ads.