Highlighted

Setting for as invalid

xrum

23-07-2008

hi,



is there a way i can set a form as invalid with script.



when i return false from my initialize event, on submit button, the form seems to gothrough anyway.



is there a build in function i can use?



Thanks!

Replies

Highlighted

Avatar

Guest

23-07-2008

On the "Click" event, you can have a script like this



if (SomeObject.rawValue != "something you want")

{

app.alert("Can't submit");

exit;

}



let me know if this works
Highlighted

xrum

23-07-2008

it still attempts to send the document with the exit;



basically, becuase there is no validation for the checkboxes, i'm doing it manually on the validate event in the submit button via javascript.



my logic is this:



- if the rest of the form is valid aka all required fields are filled in, check for the check boxes (this works)



- if the check boxes are all empty - show a message and don't submit (this is the part where it keeps submitting, no matter if i return true or false)



i'm confused. please help 😞



my submit button (validate event) looks like this:



if (myscripts.validateForm())

{

xfa.host.messageBox("returned true - submit form")

}

else

{

xfa.host.messageBox("returned false - display error and exit")

exit;

}



the value i'm getting from validateForm (true or false) is correct.
Highlighted