Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sendAndLoad to a different URL depending of checkbox

Status
Not open for further replies.

2cxc

Programmer
Aug 29, 2003
245
CA
Hi i currently have a few checkboxes on the main stage in level 1 and i was wondering how i could set the button up so that if the first check box is select and the button pressed it sendAndLoads to a specific url, and if the second check box is selected it sendAndload to a different url and so on with each checkbox. I know that if multiple checkboxes are selected this would screw things up but i'm hoping to put an alert in there to catch this before submittion, these are teh buttons actions so far, as it currently submits all chechboxes to a given url.

on (press){
formdata= new loadvars( );
formdata.1a=1a.getvalue( );
formdata.1b=1b.getvalue( );
formdata.2a=2a.getvalue( );
formdata.2b=2b.getvalue( );
formdata.3a=3a.getvalue( );
formdata.3b=3b.getvalue( );
formdata.sendAndLoad("page.asp", dummy, "POST");
 
Can't you use radio buttons instead? Only one in a group can be selected/active. Then simply condition the actual sendAndLoad based upon which radio button's state is true.
 
radios it is, but i would like to understand the rest of it first.... so to condition the actual sendAndLoad based upon which radio, starting like this?

loginButton.onRelease = function() {
how to sendAnD load based on which button is true

}
 
I guess something like this... But I've no experience with server side scripting...

loginButton.onRelease = function() {

// Don't really know if you'd add
// the following here...
formdata= new loadvars();
formdata.1a=1a.getvalue();
formdata.1b=1b.getvalue();
formdata.2a=2a.getvalue();
formdata.2b=2b.getvalue();
formdata.3a=3a.getvalue();
formdata.3b=3b.getvalue();

//But this could check the radio's states...

if(radio1.getState() == true){
formdata.sendAndLoad("page1...
}
if(radio2.getState() == true){
formdata.sendAndLoad("page2...
}
};
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top