hello! i have 4 columns of data and i would like to do something like you see when you order something and you fill in the billing address, and then there is a button for the shipping that says "same as billing?". if you check that, it autofills.
well i need 3 of the columns to be able to autofill if the user selects one of the other three as their "same as" type. if not, then the users needs to be able to type it in.
i can do it on a single checkbox, but am confused as to how to do this with an option group of 3?
any assistance would be appreciated!
oh, also, is there a way to have the option group "empty", no selection made if the user does not what to choose anything? or do i have to have an "NA" type of option button in each group?
well, i want to use option buttons. so, i put the same script on each button? in the what, mouse down event?
with a plain checkbox i had script in the textbox that needed filling, in the custom calculation script, and it worked. i cannot seem to get any code attached to the option button to work.
the check boxes are actually radio buttons that i made look like check boxes. yes, they are mutually exclusive. the group of 3 have the same name, but different values.
so, do i put the script on the mouseup event of the group, or of each one? and what exactly would that script look like? here is what i have (i am a long time programmer, but very new to Java)...
if (this.getField("OwnerSameAs")== 1) {
(this.getField("OwnerName").value)==(this.getField("RiderName").value)
}
OwnerSameAs is the name of the group of 3 check boxes.
i must be doing something really nuts!! and btw, i do appreciate the help! THANK YOU!!!
i have this on each button, so maybe i am not handling the buttons correctly? their "values" are 1,2,3. I suppose i could have yes, no, yes, or something like that. it is random when they are created, i just made them each something that made sense to me. since it is on the actual boxes, i have tried both this.getField("OwnerSameAs"), and event.targetValue, and event.rawValue. nothing happens.
if (this.getField("OwnerSameAs")== "1")
{
(this.getField("OwnerName").value)=(this.getField("RiderName").value);
}
else if (this.getField("OwnerSameAs")== "2")
{
(this.getField("OwnerName").value)=(this.getField("TrainerName").value );
}
else if (this.getField("OwnerSameAs")== "3")
{
(this.getField("OwnerName").value)=(this.getField("CoachName").value);
}
oh, sorry!! i wasn't paying close enough attention!!
thank you!! that works!!!
if i may be so bold, can you see why it says "unterminated string literal 6 at line 7 on this code? which is the "OwnerOtherPh" line? am i doing too much? or are you not supposed to have ";" at the end of each line?
if (this.getField("OwnerSameAs").value=="1")
{
this.getField("OwnerName").value=this.getField("RiderName").value;
this.getField("OwnerAddress").value=this.getField("RiderAddress").valu e;
this.getField("OwnerCityStZip").value=this.getField("RiderCityStZip"). value;
this.getField("OwnerCell").value=this.getField("RiderCell”).value;
this.getField("OwnerOtherPh").value=this.getField("RiderOtherPh").valu e;
this.getField("OwnerEmail").value=this.getField("RiderEmail").value;
this.getField("OwnerUSEF").value=this.getField("RiderUSEF").value;
this.getField("OwnerUSDF").value=this.getField("RiderUSDF").value;
}
else if (this.getField("OwnerSameAs").value=="2")
{
this.getField("OwnerName").value=this.getField("TrainerName").value;
this.getField("OwnerAddress").value=this.getField("TrainerAddress").va lue;
this.getField("OwnerCityStZip").value=this.getField("TrainerCityStZip" ).value;
this.getField("OwnerCell").value=this.getField("TrainerCell”).value;
this.getField("OwnerOtherPh").value=this.getField("TrainerOtherPh").va lue;
this.getField("OwnerEmail").value=this.getField("TrainerEmail").value;
this.getField("OwnerUSEF").value=this.getField("TrainerUSEF").value;
}
else if (this.getField("OwnerSameAs").value=="3")
{
this.getField("OwnerName").value=this.getField("CoachName").value;
this.getField("OwnerAddress").value=this.getField("CoachAddress").valu e;
this.getField("OwnerCityStZip").value=this.getField("CoachCityStZip"). value;
this.getField("OwnerCell").value=this.getField("CoachCell”).value;
this.getField("OwnerOtherPh").value=this.getField("CoachOtherPh").valu e;
this.getField("OwnerEmail").value=this.getField("CoachEmail").value;
this.getField("OwnerUSEF").value=this.getField("CoachUSEF").value;
}
hmm, maybe i cannot see the option to mark it as answered because i had to change my login name from alfaista to alfaista1. there was something messed up with my original one, i could not sign back in, it would not send me a password reset email, or an email of any sort.
anyway, THANK YOU!!! all is wonderful now!!!! i GREATLY appreciate it!!
North America
Europe, Middle East and Africa
Asia Pacific