Is there an easy way to check if the form has all manditory fields filled out in a client script?

DrewW
Mega Sage

Is there an easy way to check if the form has all manditory fields filled out in a client script? I have 9 fields that only have to be filled out at closing of an incident so I make them manditory once someone hits the close button. So now I am looking for a quick way to find out if the form is still valid. I would rather not go and get all 9 fields and check them but if that is what I have to do then that is what I have to do.

Any help would be appreciated...

8 REPLIES 8

The only thing I can think of would be to check what button was clicked. Even that may not be a perfect solution. How to do this is described here.
http://wiki.service-now.com/index.php?title=Client_Scripts#Determine_what_submit_button_was_clicked


Thats what I do first thing in the onSubmit, but it does not get there because the validation check goes off first and then does not run the onSubmit because of the new manditory fields.

I know the users are going to consider this a bug.


You may talk to support about this. I'm not sure if they would consider it a bug or not. It seems like the whole issue is that the mandatory check is happening before the 'onSubmit' script gets called. If it happened after, then you wouldn't have an issue.


I was planing on it. I was just saying that my users are going to complaine about it and say its a but, whether or not SNC sees it that way.

Thanks for all of the help everyone.