Validate text field is not blank


hi,

 

i have form submit button. make sure text field (cost code) has been filled in before submit button send form. if not user gets message "please fill in cost code". don't care value enter long field not blank.

 

i trying create [validate] rule on text field properties.

 

currently pops message not correctly. doing opposite giving message if field filled in.  

 

event.rc = event.value == "";if(!event.rc)app.alert("please fill in cost code");

 

(alternatively if know how put action on submit button, know too.)

java.png

thanks in advance if can help!

the validate event triggered when field value changes, code doesn't belong there. if use doc.submitform javascript method, cna first check relevent fields , proceed submit if checks out.

 

// mouse script submit button

// incomplete code

if (getfield("text1").valueasstring !== "") {

    submitform(arguments go here);

} else {

    app.alert(error message goes here);

}



More discussions in PDF Forms


adobe

Comments

Popular posts from this blog

how to devide a circle into equal parts

"Could not fill because there are not enough opaque source pixels" - not solved by any other thread

Why can't I change the billing info for my account?