Expand my Community achievements bar.

Reset checkboxes

Avatar

Former Community Member
Hi all,

Here is the deal,

I get an order form. People can click on check boxes.

For any check box selected, i succeeded in making editable fields appear then disappear if the check box is unselected.

So when people wants to oreder an item, he selects a check box then he can enter the quantity and sees the line amount and final total.

If he unchecks it, quantity and amount fields are hidden

So far no problem,

Then i wanted to add a reset button so the customer doesn't need to uncheck all the boxes.

And then it's mess.

The quantities and amounts fields, dissapear as wanted. So the first check box too, but the second one doesn't deselect and stay checked with error. (it's not possible to uncheck it)



here are the scripts used :

For the first check box (the second one has the same script with 2 instead of 1 ie. qty1/qty2) :



Event change / Javascript



if (this.rawValue == 0) {

form1.formulaire.qty1.presence = "hidden";

form1.formulaire.totalline1.presence = "hidden";

xfa.host.resetData("form1.formulaire.qty1")

} else {

form1.formulaire.qty1.presence = "visible";

form1.formulaire.totalline1.presence = "visible";

}



So the reset button has this script

onclick / javascript



xfa.host.resetData("form1.formulaire.ordercheckbox1,form1.formulaire.ordercheckbox2");

form1.formulaire.qty1.presence = "hidden";

form1.formulaire.totalline1.presence = "hidden";

form1.formulaire.qty2.presence = "hidden";

form1.formulaire.totalline2.presence = "hidden";



At the end, ordercheck box1 is unchecked, qty1 & qty2 are reseted and hidden, totalline1 & 2 are hidden. BUT this damned ordercheckbox2 stay here and seems bugged.



Could you help me ?



By thanks,



Loic
0 Replies