www.uburst.com www.uburst.com

"javascript form"

Go back to the LobbyClick here to Go Back to Main ListingClick here to see helpClick here to Search the Forum

Programmer Tips
Forum Type: Public
Moderator: edmunds
Time Zone: EST
Printer Friendly Format
Original Message
 
"javascript form"
Posted by Roger on Apr-08-02 at 12:40 PM (EST)
hello
i need help in how to add a modifiyer to radio button

in the example form it only shows how to add a modifier to the checkbox not the radio

here is what they have in the example javascript form
--------------------------------------------------

// Special logic for radio buttons.
if (document.P12345.card_layout[0].checked == true)
{
layout = document.P12345.card_layout[0].value;
}
else
{
layout = document.P12345.card_layout[1].value;
}

// Special logic for checkboxes.
if (document.P12345.card_other[0].checked == true)
{
additional_options += document.P12345.card_other[0].value + " ";
price_modifier += 1.0;
}
if (document.P12345.card_other[1].checked == true)
{
additional_options += document.P12345.card_other[1].value;
price_modifier += 1.0;
}

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

i need to add price to an selection
if i put it in the checkbox then that means they can add more then one..i only want one selection not multiple

an i want to be able to add price to that selection of my choosing not a predesign price


my ideal solution is to do a drop down option but i dont know how to do javascript
but i would like to have a drop down option instead of the radio or checkbox

so if anyone knows howto do both for me that would be great

1.) add a price modifier to the radio button like it is in the checkbox

2.) how to write java script for drop down option where i can put the list of items for sale an have that be modified as well with price choice


thanks please email me at
ROJERE3@aol.com
since i dont check here often

but im on aol all time..

Click to Send Alert Message to the Administrator Click to edit this messageClick to EMail Click here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents

 Table of Contents

RE: javascript form, Bill Weiner, Apr-09-02, (1)

 

 
Click here to goto Click here to goto the Lobby
Messages in this discussion
 
1 . "RE: javascript form"
Posted by Bill Weiner on Apr-09-02 at 04:51 AM (EST)
Hmmmm... So it sounds like ideally you want to dynamically change the contents of a drop-down SELECT item?

If so, then you should be able to dynamically modify the SELECT by directly modifying the options[] array, such as:

To change the first option to "Hello World":
myselect.options[0] = "Hello World";

To change the second option to "Goodbye":
myselect.options[1] = "Goodbye";

To remove the first option:
myselect.options[0] = null;

To clear the entire option list:
myselect.options.length = 0;

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents


Archive This Thread: Admin and Moderator OnlyRemove This Thread: Admin and Moderator Only
Click here to goto Click here to goto the Lobby

 

 

 

 

 

 

 

 

 

 

 

 
Questions or problems regarding this bulletin board should be directed to Webmaster
©1997-1999 by DCScripts. All rights reserved.