ok, a bit more information is needed.
There is a submission datapage (dpA) that inserts and maintains records from a table. I need also that a record is added into another table every time a new record is added on dpA. So this other datapage (dpB) receives values from parameters from dpA, inserts the record and returns control to dpA. I wanted to "hide" dpB, the user does not need to see it, and even more important, does not have to press "submit" again (already done at dpA). That's why I explored the autosubmit. So all works well this way.
The added functionality I wanted was to not add the related record in dpB when one of the passed parameter is empty. With the changes suggested, when the parameter is empty (else in check.length > 0), dpB becomes visible and I have to press the submit to return to dpA. which is not the behaviour I want. So I was expecting to have to add some code in the else part to cancel that form and return back to dpA:
while dpB hidden,
if parameter is empty then submit, else cancel,
return to DPA
Another option would be to trap the empty parameter in dpA before passing control to dpB, but I use the destination on the last part of the wizard and not sure how to put a condition there.
Hope that's a bit more clearer ...
Thanks in advance