Button (Javascript Function) - 5.0.13 -> 7.0.2 server

We have a web application with a submit button. It references a bunch of JS (main function references smaller functions). Works fine on the 5.0.13 server but does not seem to submit on the 7.0.2 server. If you click the button, it appears to pass all the field validations (inserted an alert) and appears to submit (flashes) the form. The problem… it does not show the thank you page nor saves. It just returns to a blank form. Any ideas? Seems like something with the Db running on 7.0.2 server. Was working fine on the R5 server. Any gotchas re: javascript, buttons, etc… the functions are on the form vs. JS Header or libraries.

Subject: Button (Javascript Function) - 5.0.13 → 7.0.2 server

Nope, no gotchas. There may be some cleanup in the processing order that takes place when doing a submit versus what worked in r5. What happens if at the end of your processing you insert a return True; statement? If this submits the form, it may be that you are returning false in the function somewhere and processing is stopping. Do you have code in your onSubmit? This is also the best place to put validation functions and simply use the button to issue the submit by using @command([FileSave]);@command([FileCloseWindow]) which will process the form and call the onSubmit function. Also, try removing sections of your validation code and submitting the form (I usually start with taking it all out and then put it back piece by piece). This will help determine at what point the form submission is breaking down.

Subject: RE: Button (Javascript Function) - 5.0.13 → 7.0.2 server

Thanks Joel! This is a customer’s solution… just dumped pages of JS on a form -w- a field (not a button) that includes “Type = hidden><input type="Button" value = "Save and submit for approval" onClick="saveSubmit()"” in the HTML attributes. I agree… the button is the way to go. I’ll re-create a button with the file save, etc… and reference the onSubmit. See what happens…

Something else interesting… a link hotspot disappears when running on V7. Hotspot prop. says Link - View but the value is blank. It really should be named element. Strange… maybe this is a know upgrade issue.

Subject: RE: Button (Javascript Function) - 5.0.13 → 7.0.2 server

I’m trying to place the savetest() in the form onSubmit… saying “object expected”. The name is in all lower case. This is the same funtion that was working in R5 (no changes). What am I missing?

Subject: RE: Button (Javascript Function) - 5.0.13 → 7.0.2 server

It sounds as if there is an issue referencing the function. Make sure that the function savetest itself resides in the JSHeader or in a JS library referenced in the JSHeader. Then the call should go into the onSubmit with no problems. You will need to ensure that if you have any parameters, that they are passed to the function.