The RPG Maker Resource Kit

RMRK General => General Chat => Topic started by: tSwitch on February 11, 2009, 02:02:00 PM

Title: HTML and I'm Stumped
Post by: tSwitch on February 11, 2009, 02:02:00 PM
I need to maek a form for my company's website.
all dropdown lists.

<select><option> etc... is easy enough

but they want the dropdowns to disable until you select a previous one
and I need some way to actively check their values so it can spit out an answer in a text box lower on the page.

oh god x_x;;
Title: Re: HTML and I'm Stumped
Post by: :) on February 11, 2009, 02:25:29 PM
I think the method is called 'auto populating', maybe that can help you search it better.

also it would be easier (fer ropette) if you went ahead and outlined the form.

--Drop Down 1
---Dog (if selected jump to Drop Down 3)
---Cat (if selected jump to Drop Down 2)

--Drop Down 2
---hair ball
---cats are gay

--Drop Down3
---Dogs rule
---Nightwolf eats dogs

and so on
and I dont think its only going to be HTML
Title: Re: HTML and I'm Stumped
Post by: tSwitch on February 11, 2009, 02:32:38 PM
me either.

it's like...

option 1 <selection options>
option 2 <selection options>
option 3 <selection options>
option 4 <selection options>
option 5 <selection options>
text box with results based on 1-5

and 2 needs to change based on 1 and 3 needs to change based on 2

x_x;;
Title: Re: HTML and I'm Stumped
Post by: Roph on February 11, 2009, 02:36:06 PM
Use javascript and an onChange="YourCheckFunction()" to change the values.

<script language="Javascript">
function NAMformchange()
{
if(namform.IPrefer.value == "3")
{
//They changed the select to cocks, they must like penises
namform.ILike.value = "penises";
}
else if(namform.IPrefer.value == "0")
{
//No pref, empty it
namform.ILike.value = "";
}
}
</script>

<form name="namform" action="namckor.com/vulgar.php" method="post" enctype="application/x-www-form-urlencoded">
<select name="IPrefer" onChange="NAMformchange()">
<option value="0" selected>Nothing</option>
<option value="1">Butt</option>
<option value="2">Vagina</option>
<option value="3">Cocks</option>
</select>
<input name="ILike" type="text" value="" size="5" maxlength="50">
</form>

Title: Re: HTML and I'm Stumped
Post by: tSwitch on February 11, 2009, 02:40:02 PM
how about the changing the 2 and 3?
is there a function for adding selections that I could call on change?

edit: maybe onChange of 1-4 I could mess around and just re-write the HTML of the div that the form is in?
Title: Re: HTML and I'm Stumped
Post by: :) on February 11, 2009, 07:50:10 PM
this is pretty sweet:
http://css-tricks.com/examples/SeminarRegTutorial/
Title: Re: HTML and I'm Stumped
Post by: tSwitch on February 11, 2009, 08:26:26 PM
Quote from: Noumes on February 11, 2009, 07:50:10 PM
this is pretty sweet:
http://css-tricks.com/examples/SeminarRegTutorial/

yeah, too bad my boss hates cool stuff like that
Title: Re: HTML and I'm Stumped
Post by: Kokowam on February 11, 2009, 09:45:42 PM
Tell him to piss off, then. :V

Anyways, I can still click the step 2 when I haven't done step 1 yet. D:
Title: Re: HTML and I'm Stumped
Post by: ahref on February 12, 2009, 12:05:32 AM
Quote from: NAMKCOR on February 11, 2009, 08:26:26 PM
Quote from: Noumes on February 11, 2009, 07:50:10 PM
this is pretty sweet:
http://css-tricks.com/examples/SeminarRegTutorial/

yeah, too bad my boss hates cool stuff like that

thats in this months issue of .net magazine(practical web design for you americans) the developer guides you through creating it :D
Title: Re: HTML and I'm Stumped
Post by: :) on February 12, 2009, 01:17:26 AM
Quote from: ahref on February 12, 2009, 12:05:32 AM
Quote from: NAMKCOR on February 11, 2009, 08:26:26 PM
Quote from: Noumes on February 11, 2009, 07:50:10 PM
this is pretty sweet:
http://css-tricks.com/examples/SeminarRegTutorial/

yeah, too bad my boss hates cool stuff like that

thats in this months issue of .net magazine(practical web design for you americans) the developer guides you through creating it :D

I know :D
Title: Re: HTML and I'm Stumped
Post by: tSwitch on February 12, 2009, 04:01:12 PM
long code is long

function formchange() {
if(Aspen_Selector.Manufacturer.value == "1") {
//----------------
//Chigo
//----------------
BTU = parseFloat(Aspen_Selector.BTU.value);
if(BTU == 9000) {
if(Aspen_Selector.Voltage.value == "1") {
if(Aspen_Selector.Installation.value == "1") {
Feet = parseFloat(Aspen_Selector.Feet.value);
if(Feet >= 0 && Feet <= 26) {
alert("ASP-ML-115");
} else if(Aspen_Selector.Feet.value >= "27" && Aspen_Selector.Feet.value <= "49") {
} else {
}
} else if(Aspen_Selector.Installation.value == "2" || Aspen_Selector.Installation.value == "3") {
if(Aspen_Selector.Feet.value >= "0" && Aspen_Selector.Feet.value <= "26") {
} else if(Aspen_Selector.Feet.value >= "27" && Aspen_Selector.Feet.value <= "65") {
} else {
}
} else if(Aspen_Selector.Installation.value == "4") {
if(Aspen_Selector.Feet.value >= "0" && Aspen_Selector.Feet.value <= "33") {
}
} else {
}
} else {
}
} else if(Aspen_Selector.BTU.value == "12000") {
if(Aspen_Selector.Voltage.value == "1") {
if(Aspen_Selector.Installation.value == "1") {
if(Aspen_Selector.Feet.value >= "0" && Aspen_Selector.Feet.value <= "26") {
} else if(Aspen_Selector.Feet.value >= "27" && Aspen_Selector.Feet.value <= "49") {
} else {
}
} else if(Aspen_Selector.Installation.value == "2" || Aspen_Selector.Installation.value == "3") {
if(Aspen_Selector.Feet.value >= "0" && Aspen_Selector.Feet.value <= "26") {
} else if(Aspen_Selector.Feet.value >= "27" && Aspen_Selector.Feet.value <= "65") {
} else {
}
} else if(Aspen_Selector.Installation.value == "4") {
if(Aspen_Selector.Feet.value >= "0" && Aspen_Selector.Feet.value <= "33") {
}
} else {
}
} else {
}
} else if(Aspen_Selector.BTU.value == "18000") {
if(Aspen_Selector.Voltage.value == "1") {
if(Aspen_Selector.Installation.value == "1") {
if(Aspen_Selector.Feet.value >= "0" && Aspen_Selector.Feet.value <= "26") {
} else if(Aspen_Selector.Feet.value >= "27" && Aspen_Selector.Feet.value <= "49") {
} else {
}
} else if(Aspen_Selector.Installation.value == "2" || Aspen_Selector.Installation.value == "3") {
if(Aspen_Selector.Feet.value >= "0" && Aspen_Selector.Feet.value <= "26") {
} else if(Aspen_Selector.Feet.value >= "27" && Aspen_Selector.Feet.value <= "65") {
} else {
}
} else if(Aspen_Selector.Installation.value == "4") {
if(Aspen_Selector.Feet.value >= "0" && Aspen_Selector.Feet.value <= "33") {
}
} else {
}
} else {
}
} else if(Aspen_Selector.BTU.value == "24000") {
if(Aspen_Selector.Voltage.value == "1") {
if(Aspen_Selector.Installation.value == "1") {
if(Aspen_Selector.Feet.value >= "0" && Aspen_Selector.Feet.value <= "26") {
} else if(Aspen_Selector.Feet.value >= "27" && Aspen_Selector.Feet.value <= "49") {
} else {
}
} else if(Aspen_Selector.Installation.value == "2" || Aspen_Selector.Installation.value == "3") {
if(Aspen_Selector.Feet.value >= "0" && Aspen_Selector.Feet.value <= "26") {
} else if(Aspen_Selector.Feet.value >= "27" && Aspen_Selector.Feet.value <= "65") {
} else {
}
} else if(Aspen_Selector.Installation.value == "4") {
if(Aspen_Selector.Feet.value >= "0" && Aspen_Selector.Feet.value <= "33") {
}
} else {
}
} else {
}
} else {
}
} else if(Aspen_Selector.Manufacturer.value == "2") {

} else if(Aspen_Selector.Manufacturer.value == "3") {

} else if(Aspen_Selector.Manufacturer.value == "4") {

} else if(Aspen_Selector.Manufacturer.value == "5") {

} else if(Aspen_Selector.Manufacturer.value == "6") {

}
}


there's the JS I'm working on for it.
here's the HTML


<form name="Aspen_Selector">
                                Manufacturer:
                                <select name="Manufacturer" onChange="formchange()">
                                    <option value="0"></option>
                                    <option value="1">Chigo</option>
                                </select>
                                <br />
                                <br />
                                BTU/Hr: <input type="text" name="BTU" size="14" onChange="formchange()"/>
                                <br />
                                <br />
                                Voltage:
                                <select name="Voltage" onChange="formchange()">
                                    <option value="0"></option>
                                    <option value="1">115v</option>
                                    <option value="2">230v</option>
                                    <option value="3">24v</option>
                                </select>
                                <br />
                                <br />
                                Installation Type:
                                <select name="Installation" onChange="formchange()">
                                    <option value="0"></option>
                                    <option value="1">Side Entry Surface w/elbow</option>
                                    <option value="2">Side Entry Eurface Straight</option>
                                    <option value="3">Rear Entry</option>
                                    <option value="4">Exposed Pump installation</option>
                                </select>
                                <br />
                                <br />
                                Feet off Head: <input type="text" name="Feet" size="14" onChange="formchange()"/>
                                <input type="button" value="Submit" onclick="formchange()" />
                            </form>


it's not working ;o;
what am I doing wrong?

if you were to select 'Chigo', 9000btu's, 115 volts, Side Entry Surface w/elbow Installation, and 0-26 feet off head, it shoud pop up an alert with "ASP-ML-115"

edit: it works in IE but not firefox?
Title: Re: HTML and I'm Stumped
Post by: tSwitch on February 13, 2009, 01:38:22 PM
I'm going to bump this because I still cant figure out what's wrong. :tpg:

edit: it's not the javascript, because all the rest of the site's javascript works fine.
        somehow it's the form, but roph's works fine, and I can't see what I'm doing different.
        other than using onclick of the button instead of onchange of the lists...which...
        doesn't work either.