[advanced search]
Results from the most recent live auction are here.
24 members in the live chat room. Join Chat!
Register Rules & FAQ NP$ Store Active Threads Mark Forums Read
Go Back   NamePros.Com > Design and Development > Programming
User Name
Password

Old 07-06-2008, 04:10 PM   · #1
slipondajimmy
Senior Member
 
Name: Donnie
Location: Florida
Trader Rating: (48)
Join Date: Nov 2003
Posts: 1,995
NP$: 83.00 (Donate)
slipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to behold
Quick Question. Hope someone can help

Hey Everyone.

I need to know how in the world I can make it so the 3-6, 6-12, and 12-18 options will only show that white is available. Every other size except these are available in the other colors.

Code:
<td><select name="os1" class="cnt" id="size"> <option>3-6mo</option> <option>6-12mo</option> <option>12-18mo</option> <option>2T</option> <option>3T</option> <option>4T</option> <option>XS</option> <option>S</option> </select> <select name="os0" class="cnt" id="select"> <option selected>White</option> <option>Red</option> <option>Gray</option> </select> <input name="on0" type="hidden" id="on02" value="color" /> <input name="on1" type="hidden" id="on12" value="size" /> <input name="quantity" type="text" id="quantity2" value="1" size="3" maxlength="5" /></td> </tr> </table></td>


Please register or log-in into NamePros to hide ads
slipondajimmy is offline   Reply With Quote
Old 07-06-2008, 04:33 PM   · #2
SecondVersion
while ($awake){ code(); }
 
SecondVersion's Avatar
 


Name: Eric
Location: Kentucky
Trader Rating: (142)
Join Date: Mar 2005
Posts: 4,239
NP$: 384.00 (Donate)
SecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond repute
Member of the Month
MOTM September 2005 Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Cancer Alzheimer's Protect Our Planet
Not the best, but it works.
PHP Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html>

<
head>
    <
meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
    <
title>Untitled 1</title>
    <
script type="text/javascript" language="Javascript">
    function
onlyWhite(select)
    {
        var
select = document.getElementById('size');
        var
value = select.options[select.selectedIndex].value;
        var
cselect = document.getElementById('select');

        if (
value == '3-6mo' || value == '6-12mo' || value == '12-18mo')
        {
            
cselect.options.length = 0;
            
cselect.options[0] = new Option("----------", "-1", false, false);
            
cselect.options[1] = new Option("White", "white", false, false);
        }
        else
        {
            
cselect.options.length = 0;
            
cselect.options[0] = new Option("----------", "-1", false, false);
            
cselect.options[1] = new Option("White", "white", false, false);
            
cselect.options[2] = new Option("Red", "red", false, false);
            
cselect.options[3] = new Option("White", "Gray", false, false);
        }
        return;
    }
    
</script>
</head>

<body>

<select name="os1" class="cnt" id="size" onchange="onlyWhite()">
    <option value="-1">----------</option>
    <option value="3-6mo">3-6mo</option>
    <option value="6-12mo">6-12mo</option>
    <option value="12-18mo">12-18mo</option>
    <option value="2T">2T</option>
    <option value="3T">3T</option>
    <option value="4T">4T</option>
    <option value="XS">XS</option>
    <option value="S">S</option>
</select>
<select name="os0" class="cnt" id="select">
    <option value="-1">----------</option>
    <option value="white">White</option>
    <option value="red">Red</option>
    <option value="gray">Gray</option>
</select>

</body>
</html>
__________________

SecondVersion.com - The Personal Blog of SecondVersion
Domain Name Portfolio - Get your free copy. - Version 1.0.2 now available!!
MetaCreator.com - Free Meta Tag Creator
CodingPlanet.com - Coming soon...
SecondVersion is offline   Reply With Quote
Old 07-06-2008, 04:35 PM   · #3
Bruce_KD
NamePros Member
 
Trader Rating: (1)
Join Date: Sep 2006
Posts: 78
NP$: 100.00 (Donate)
Bruce_KD will become famous soon enoughBruce_KD will become famous soon enough
Code:
<script type='text/javascript'> function disableColors(select) { var sId = select.selectedIndex < 3?true:false; var colors = document.getElementById('select'); colors.options[1].disabled = sId; colors.options[2].disabled = sId; if (sId && colors.selectedIndex > 0) colors.selectedIndex = 0; } </script> <select name="os1" class="cnt" id="size" onchange="disableColors(this);"> <option>3-6mo</option> <option>6-12mo</option> <option>12-18mo</option> <option>2T</option> <option>3T</option> <option>4T</option> <option>XS</option> <option>S</option> </select> <select name="os0" class="cnt" id="select"> <option>White</option> <option>Red</option> <option>Gray</option> </select>


This basically says:
When you change the size of the shirt, check which size you changed it to.
If its the first, second, or third option (selectedIndex starts with the top option being 0, so when selectedIndex < 3), disable the second and third color options.

After doing that, check which color was previously selected. If you had to disable options And the second or third color was selected, set it to white.


Bruce
Bruce_KD is offline   Reply With Quote
Old 07-06-2008, 05:37 PM   · #4
slipondajimmy
Senior Member
 
Name: Donnie
Location: Florida
Trader Rating: (48)
Join Date: Nov 2003
Posts: 1,995
NP$: 83.00 (Donate)
slipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to behold
Thanks for everyones help. I will try to implement this and see what happens
slipondajimmy is offline   Reply With Quote
Old 07-07-2008, 03:47 AM   · #5
slipondajimmy
Senior Member
 
Name: Donnie
Location: Florida
Trader Rating: (48)
Join Date: Nov 2003
Posts: 1,995
NP$: 83.00 (Donate)
slipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to behold
Hey Eric,

I have another question. Is there a way to make that so it will always show 3-6 and white as the default? So the first thing someone sees in the drop down would look this

3-6 White

instead of

------ -------

Then the customer would be able to pick the other sizes and color.

The reason I want to do this is these are only available in white

<option>3-6mo</option>
<option>6-12mo</option>
<option>12-18mo</option>

The other ones are multiple colors.

Thanks again
slipondajimmy is offline   Reply With Quote
Old 07-07-2008, 03:49 AM   · #6
shockie
Senior Member
 
shockie's Avatar
 
Trader Rating: (59)
Join Date: Dec 2006
Posts: 3,344
NP$: 1617.20 (Donate)
shockie has a brilliant futureshockie has a brilliant futureshockie has a brilliant futureshockie has a brilliant futureshockie has a brilliant futureshockie has a brilliant futureshockie has a brilliant futureshockie has a brilliant futureshockie has a brilliant futureshockie has a brilliant futureshockie has a brilliant future
Code:
<option selected>3-6mo</option>
__________________
- shockie
████ Watch FREE Domain Videos By Gurus ████
Cheap Web Hosting - 99.9%+ Uptime, Unlimited add-ons domains | From $2
Available Domain Names, Development and Investment Guides + Portfolio
shockie is offline   Reply With Quote
Old 07-07-2008, 09:32 AM   · #7
slipondajimmy
Senior Member
 
Name: Donnie
Location: Florida
Trader Rating: (48)
Join Date: Nov 2003
Posts: 1,995
NP$: 83.00 (Donate)
slipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to behold
Thanks Shockie I will try that out tonight
slipondajimmy is offline   Reply With Quote
Reply

NamePros is a revenue sharing forum.

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Site Sponsors
Hunting Moon EscrowDNS Proof is in the Parking
Advertise your business at NamePros
All times are GMT -7. The time now is 07:22 PM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0