Js validation and subforms for the web

I have a form: "Request"It has a computed subform that is called depending on client = Notes or Web. (this question concerns web)

I have js validations in the js header of the Form (not subform)

I have a submit button on the subform that does the standard document.forms[0].submit()

My validations will run against any field on the (web) subform, but will not run against fields that are located on the form itself. Am I missing something? I have tested this thoroughly and all fields on the subform can be validated using the js header of the form - but not fields on the form itself.

Has anyone else experienced this?

Subject: js validation and subforms for the web

Hello!

Actually, the browser doesn’t really care if the fields are in a form or a subform. It shouldn’t make a difference. There are some things to look out for, though:

  • Do you have any html “form” tags? It could be that the subform has an html “form” in it, which would make the validation ignore the main form.

  • Make sure the subform isn’t in a table cell. This might not be a problem, but sometimes causes issues.

  • Are the fields in the form (or subform) in pass-thru html? This might be an issue.

For the fun of it, copy the fields from your form into your subform, and try. Or, vice versa.

Good luck & happy hunting!

Steve in NYC

“It hurts to be on the cutting edge.”

Subject: RE: js validation and subforms for the web

Agreed.

One very easy way to check the (effective) structure of an HTML file is to use Jennifer Madden’s excellent View Source Chart Firefox add-on:

http://jennifermadden.com/scripts/ViewRenderedSource.html

Subject: Harkpabst, that’s for this great link. And…

thanks to Steve and Yazdi for your responses. I appreciate your time.

Subject: RE: js validation and subforms for the web

This is exactly as I thought. So your (and Yazdi’s) suggestion is well taken. I will review the form for additional html coding that may be removing it from the scope of the scripting.

The field is definetly not pass-thru nor is it in a table cell.

Thanks for the additional suggestions.

Subject: js validation and subforms for the web

Seems to be a scope of variables that is troubling you, check yr code thoroughly to see if the form variables and subform variables are within the same scope.

Do a View Source to see the webcode,