hey everyone,
i've been trying to solve this problem for 2 days straight, with no end in sight. i would greatly appreciate anyone's help.
EXPLANATION: There are 3 Select Menus. The 1st and 2nd Select Menu are "printing options" for 4x6 and 5x7 prints respectively. the 3rd Select Menu holds an "Email" option that can be toggled (appear/reappear) by the 1st and 2nd Select Menus. So if a user selects prints from either 4x6 or 5x7 menu, the "Email" option should disappear so the user can't select it (after all, you can't really email prints right?). The goal is that if there are any 4x6 or 5x7 prints selected (separately or simultaneously) , the "Email" option will not be available.
THE PROBLEM: both 4x6 and 5x7 Select Menus work separately, but getting them to work together is the trouble. for example: if you choose any 4x6 prints, the "Email" option disappears, then if you select "4x6 File (With Email Option!)", the "Email" option will reappear. the same goes for the 5x7 Select Menu if it is uses seperatly.
however, if at first a user wants to have 4x6 and 5x7 prints done, the "Email" option disappears. but if the user changes his/her mind about the 5x7 prints, and changes that select menu back to "5x7 File (With Email Option)" while the 4x6 Select Menu is still selecting a print, the "Email" option will reappear! again, the goal is to have the "Email" option unavailable if either of the Select Menus have any prints selected.
[HTML]
<HTML>
<HEAD>
<SCRIPT LANGUAGE=JavaSc ript>
function ToggleEmail4x6 (val)
{
if(val=="4x6_0" )
{AddEmailToRece ving()}
else {RemoveEmailFro mReceving()}
}
function ToggleEmail5x7 (val)
{
if(val=="5x7_0" )
{AddEmailToRece ving()}
else {RemoveEmailFro mReceving()}
}
function RemoveEmailFrom Receving()
{
if (document.IMAGE Form.recevingop tions.options[2].text == "Email")
{document.IMAGE Form.recevingop tions.options[2] = null;}
}
function AddEmailToRecev ing()
{
if (document.IMAGE Form.recevingop tions.options[2].text != "Email")
{
var indexCounter;
var recevingchoice = document.IMAGEF orm.recevingopt ions;
var lastoption = new Option();
recevingchoice. options[3] = lastoption;
for (indexCounter = 3;indexCounter > 2; indexCounter--)
{
recevingchoice. options[indexCounter].text = recevingchoice. options[indexCounter - 1].text;
recevingchoice. options[indexCounter].value = recevingchoice. options[indexCounter - 1].value;
}
var option = new Option("Email", 2);
recevingchoice. options[2] = option;
}
}
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME=IMAGEForm>
<p><BR><label ></label>
A) Please Select Prints </p>
<p>
<label>
<select name=4x6printop tions onChange="Toggl eEmail4x6(this. value)">
<option value="4x6_0">4 x6 File (With Email Option!)</option>
<option value="4x6_1">O ne 4x6 Print</option>
<option value="4x6_2">T wo 4x6 Prints</option>
<option value="4x6_3">T hree 4x6 Prints</option>
</select>
</label>
</p>
<p>
<label>
<select name=5x7printop tions onChange="Toggl eEmail5x7(this. value)">
<option value="5x7_0">5 x7 File (With Email Option!)</option>
<option value="5x7_1">O ne 5x7 Print</option>
<option value="5x7_2">T wo 5x7 Prints</option>
<option value="5x7_3">T hree 5x7 Prints</option>
</select>
</label>
</p>
<p> </p>
<p>B) Please Select your Receving Choice:<BR>
<select name=recevingop tions size="4">
<option value="0">
<option value="1">Couri er
<option value="2">Email
<option value="3">Local Pick-Up
</select>
</p>
</FORM>
</BODY>
</HTML>
[/HTML]
Edited by iam_clint: Please wrap your code in [ code] or [ html] tags. I did it for you this time.
Thanks for anyone's help!
i've been trying to solve this problem for 2 days straight, with no end in sight. i would greatly appreciate anyone's help.
EXPLANATION: There are 3 Select Menus. The 1st and 2nd Select Menu are "printing options" for 4x6 and 5x7 prints respectively. the 3rd Select Menu holds an "Email" option that can be toggled (appear/reappear) by the 1st and 2nd Select Menus. So if a user selects prints from either 4x6 or 5x7 menu, the "Email" option should disappear so the user can't select it (after all, you can't really email prints right?). The goal is that if there are any 4x6 or 5x7 prints selected (separately or simultaneously) , the "Email" option will not be available.
THE PROBLEM: both 4x6 and 5x7 Select Menus work separately, but getting them to work together is the trouble. for example: if you choose any 4x6 prints, the "Email" option disappears, then if you select "4x6 File (With Email Option!)", the "Email" option will reappear. the same goes for the 5x7 Select Menu if it is uses seperatly.
however, if at first a user wants to have 4x6 and 5x7 prints done, the "Email" option disappears. but if the user changes his/her mind about the 5x7 prints, and changes that select menu back to "5x7 File (With Email Option)" while the 4x6 Select Menu is still selecting a print, the "Email" option will reappear! again, the goal is to have the "Email" option unavailable if either of the Select Menus have any prints selected.
[HTML]
<HTML>
<HEAD>
<SCRIPT LANGUAGE=JavaSc ript>
function ToggleEmail4x6 (val)
{
if(val=="4x6_0" )
{AddEmailToRece ving()}
else {RemoveEmailFro mReceving()}
}
function ToggleEmail5x7 (val)
{
if(val=="5x7_0" )
{AddEmailToRece ving()}
else {RemoveEmailFro mReceving()}
}
function RemoveEmailFrom Receving()
{
if (document.IMAGE Form.recevingop tions.options[2].text == "Email")
{document.IMAGE Form.recevingop tions.options[2] = null;}
}
function AddEmailToRecev ing()
{
if (document.IMAGE Form.recevingop tions.options[2].text != "Email")
{
var indexCounter;
var recevingchoice = document.IMAGEF orm.recevingopt ions;
var lastoption = new Option();
recevingchoice. options[3] = lastoption;
for (indexCounter = 3;indexCounter > 2; indexCounter--)
{
recevingchoice. options[indexCounter].text = recevingchoice. options[indexCounter - 1].text;
recevingchoice. options[indexCounter].value = recevingchoice. options[indexCounter - 1].value;
}
var option = new Option("Email", 2);
recevingchoice. options[2] = option;
}
}
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME=IMAGEForm>
<p><BR><label ></label>
A) Please Select Prints </p>
<p>
<label>
<select name=4x6printop tions onChange="Toggl eEmail4x6(this. value)">
<option value="4x6_0">4 x6 File (With Email Option!)</option>
<option value="4x6_1">O ne 4x6 Print</option>
<option value="4x6_2">T wo 4x6 Prints</option>
<option value="4x6_3">T hree 4x6 Prints</option>
</select>
</label>
</p>
<p>
<label>
<select name=5x7printop tions onChange="Toggl eEmail5x7(this. value)">
<option value="5x7_0">5 x7 File (With Email Option!)</option>
<option value="5x7_1">O ne 5x7 Print</option>
<option value="5x7_2">T wo 5x7 Prints</option>
<option value="5x7_3">T hree 5x7 Prints</option>
</select>
</label>
</p>
<p> </p>
<p>B) Please Select your Receving Choice:<BR>
<select name=recevingop tions size="4">
<option value="0">
<option value="1">Couri er
<option value="2">Email
<option value="3">Local Pick-Up
</select>
</p>
</FORM>
</BODY>
</HTML>
[/HTML]
Edited by iam_clint: Please wrap your code in [ code] or [ html] tags. I did it for you this time.
Thanks for anyone's help!
Comment