Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 10-31-2008, 04:24 PM   #1 (permalink)
objecterror's Avatar
 
Ultra Techie

Join Date: Jan 2006

Location: vegas

Posts: 686

objecterror is on a distinguished road

Default Advanced HTML Forms

I'm back!
This time with some thing that's a little advanced(atleast to me it is).
I'm working on a revamp of this business website Superb Technologies and, I want to add a form of list options for the customer to choose an option from.
Here is the source code I have so far:
HTML Code:
<b>Find out your price</b>
<FORM NAME="DropDown">
<SELECT NAME="DDlinks" onChange="LinkUp(this.form)">
<OPTION>Select Television Type</OPTION>
<OPTION>LCD</OPTION>
<OPTION>DLP</OPTION>
<OPTION>PLASMA</OPTION>
</SELECT>
</FORM> 
This is all good and fine, but, some customers may think LCD screens go as far as 70'' or plasma screens are as small as 40''. I want to eliminate selections as they make a selection, kind of grouping there options as they choose there television, the size and then the kind of service they want. Thanks in advance
objecterror is offline  
Old 10-31-2008, 05:53 PM   #2 (permalink)
Yek
 
T.F's Resident Cool Guy...

Join Date: Aug 2006

Posts: 1,625

Yek is on a distinguished road

Send a message via AIM to Yek Send a message via MSN to Yek Send a message via Yahoo to Yek Send a message via Skype™ to Yek
Default Re: Advanced HTML Forms

Consider JQuery, it's probberly going to be your best bet in this situation as im not aware of HTML's power to do this entirely on it's own.

You can find out more info at jQuery: The Write Less, Do More, JavaScript Library

Let me know

Cheers,

~ Tkey
Yek is offline  
Old 10-31-2008, 11:17 PM   #3 (permalink)
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,683

CrazeD will become famous soon enough

Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default Re: Advanced HTML Forms

Code:
<script type="text/javascript">
function disableOption(index)
{
	switch (index.value)
	{
	case 'LCD':
		document.getElementById('40').disabled = false;
		document.getElementById('50').disabled = false;
		document.getElementById('60').disabled = false;
		document.getElementById('70').disabled = true;
	break;

	case 'DLP':
		document.getElementById('40').disabled = false;
		document.getElementById('50').disabled = false;
		document.getElementById('60').disabled = false;
		document.getElementById('70').disabled = false;
		
	break;

	case 'Plasma':
		document.getElementById('40').disabled = true;
		document.getElementById('50').disabled = false;
		document.getElementById('60').disabled = false;
		document.getElementById('70').disabled = false;
	break;	
	}
}

</script>

<form>
<select onchange="disableOption(this.options[this.selectedIndex]);">
<option value="">Select Television Type</option>
<option value="LCD" id="LCD">LCD</option>
<option value="DLP" id="DLP">DLP</option>
<option value="Plasma" id="Plasma">Plasma</option>
</select>
<br />
<select>
<option value="">Select Your Size</option>
<option value="40" id="40">40&quot;</option>
<option value="50" id="50">50&quot;</option>
<option value="60" id="60">60&quot;</option>
<option value="70" id="70">70&quot;</option>
</select>
</form>
Is this what you meant?
__________________

Need website help? PM me!
CrazeD is offline  
Old 10-31-2008, 11:52 PM   #4 (permalink)
objecterror's Avatar
 
Ultra Techie

Join Date: Jan 2006

Location: vegas

Posts: 686

objecterror is on a distinguished road

Default Re: Advanced HTML Forms

Wow, that's exactly what I mean crazed, I was looking at the link provided by tkey, I can add and adjust the selections from here right?
objecterror is offline  
Old 11-01-2008, 12:06 AM   #5 (permalink)
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,683

CrazeD will become famous soon enough

Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default Re: Advanced HTML Forms

Yes. If you understand basic HTML/JS, you should understand that code at least a little.

If you want to disable say, 60" and 70" when you click LCD, then on this part:

Code:
case 'LCD':
		document.getElementById('40').disabled = false;
		document.getElementById('50').disabled = false;
		document.getElementById('60').disabled = false;
		document.getElementById('70').disabled = true;
	break;
Change document.getElementById('60').disabled = false; to true.

If you want to add more TV types, just add them the same way I did, and then add a new case in the Javascript. Note that you'll have to tell all the other sizes to be true/false every time, because say you click LCD which disables 70", then you click Plasma, the 70" will still be disabled...so you have to turn it back on under the Plasma case.
__________________

Need website help? PM me!
CrazeD is offline  
Old 11-01-2008, 04:33 AM   #6 (permalink)
objecterror's Avatar
 
Ultra Techie

Join Date: Jan 2006

Location: vegas

Posts: 686

objecterror is on a distinguished road

Default Re: Advanced HTML Forms

So like an on and off switch as long as I remember which category I'm looking at. I will be having fun with this. I just set up a merchant account online and making the page flow better with a little added complexity for the forms i'm using. thanks crazed
objecterror is offline  
Old 11-01-2008, 05:18 AM   #7 (permalink)
Baez's Avatar
 

Join Date: Sep 2005

Location: Toronto, Canada

Posts: 5,465

Baez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of light

Default Re: Advanced HTML Forms

Object do you think you could send me the source of that?
__________________

Baez is offline  
Old 11-02-2008, 07:52 PM   #8 (permalink)
objecterror's Avatar
 
Ultra Techie

Join Date: Jan 2006

Location: vegas

Posts: 686

objecterror is on a distinguished road

Default Re: Advanced HTML Forms

Quote:
Originally Posted by cvb724 View Post
Object do you think you could send me the source of that?
Which source specifically? I have a few
objecterror is offline  
Old 11-02-2008, 11:53 PM   #9 (permalink)
Baez's Avatar
 

Join Date: Sep 2005

Location: Toronto, Canada

Posts: 5,465

Baez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of light

Default Re: Advanced HTML Forms

What you have man . I didn't realize there was more than one. I want to get my xHTML skills higher. Too much studying of game programming and advanced ASP.NET right now.
__________________

Baez is offline  
 
Closed Thread

Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Please help with HTML Ebay listing, auction description runs off into the rest of the Mr. LL Programming Discussions 5 08-27-2008 03:40 PM
Posting Form data to HTML page kizzeith Programming Discussions 15 02-03-2008 06:54 AM
I want to PRINT on forms that are in my printer automatic feeder... rocket1406 Windows Operating Systems and Software 3 08-06-2007 07:46 PM