These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Resetting a checkbox

francisvaneycken
Registered: Mar 30 2009
Posts: 37

Hi to all,

I've got two questions :

This form has a checkbox with default rawValue 0 and a text in subform 1

When the checkbox is clicked on, a numeric field opens and the text form subform 1 changes into the text form subform 2

Here's the java syntax

if(this.rawValue == 0)
Lidnummer.presence = "hidden";
else
Lidnummer.presence = "visible";
AVGeenLid.presence = "hidden";
AVLid.presence = "visible";

Now what I want is when the user changes his mind but has already clicked on the checkbox so the numeric field (Lidnummer)has appeared and subform 1 (AVGeenLid) has changed into subform 2 (AVLid)
unchecks the checkbox(LidBTSC)
the numeric field becomes back hidden and the subform2 (AVLid) gets back hidden and subform1 (AVGeenLid) appears again.

Furthermore,

I have placed an agreementcheckbox under this subforms, which I want to link to my emailsubmit-button.

So, when this checkbox isn't checked, users cannot send the form.

Who can and will help me with this problems.

Thanks in advance!

Francis

My Product Information:
LiveCycle Designer, Windows
jonom
Registered: Jan 31 2008
Posts: 133
If I understand correctly what you are after, you should just have to add the subform states you want to the first part of the if statement.

if(this.rawValue == 0)
Lidnummer.presence = "hidden";
AVGeenLid.presence = "visible";
AVLid.presence = "hidden";
else
Lidnummer.presence = "visible";
AVGeenLid.presence = "hidden";
AVLid.presence = "visible";


Someone else will have to help you with your other question.
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Hi Francis,

you can create a button for mailing the form, that checks the agreement checkbox before the mailing process.
Use a regular button, not Designers standard mail button for this!
Add the following JavaScript to its mouse up-event.

if (Checkbox.rawValue == null){app.alert({cMsg:"You have to accept the agreement before you can proceed.",cTitle: "Missing agreement", nIcon: 1, nType: 0} );}else{var myDoc = event.target;var address = "<span class="spamspan"><span class="u">myname</span> [at] <span class="d">domain [dot] com</span></span>"var sub = "Returned form...";var msgBody = "Hello..."; myDoc.mailDoc({bUI: false,cTo: address,cSubject: sub,cMsg: msgBody,cSubmitAs: "PDF"});

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

francisvaneycken
Registered: Mar 30 2009
Posts: 37
Hi Marcus,

This is the code I used; except for the emailaddress.

if (Akkoord.rawValue == null)
{
app.alert({cMsg:"Zonder je goedkeuring kan je dit formulier niet indienen.",cTitle: "Goedkeuring ontbreekt!", nIcon: 1, nType: 0} );
}
else
{
var myDoc = event.target;
var address = "xxx [at] xxx [dot] com"
var sub = "Aanvraag interventie";
var msgBody = "Gelieve interventie in bijlage uit te voeren";

myDoc.mailDoc({
bUI: false,
cTo: address,
cSubject: sub,
cMsg: msgBody,
cSubmitAs: "PDF"
});

I'm afraid it doesn't work.

Have I made a mistake? Do I have to change MyDoc.maildoc into something else?
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Well, I missed one } in my example at the end.
That may be the reason.

if (Akkoord.rawValue == null)
{
app.alert({cMsg:"Zonder je goedkeuring kan je dit formulier niet indienen.",cTitle: "Goedkeuring ontbreekt!", nIcon: 1, nType: 0} );
}
else
{
var myDoc = event.target;
var address = "xxx [at] xxx [dot] com"
var sub = "Aanvraag interventie";
var msgBody = "Gelieve interventie in bijlage uit te voeren";

myDoc.mailDoc
({
bUI: false,
cTo: address,
cSubject: sub,
cMsg: msgBody,
cSubmitAs: "PDF"
});
}

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

francisvaneycken
Registered: Mar 30 2009
Posts: 37
Sorry Radzmar but this doesn't work. Nothing happens...

Did you test this?

Francis