JavaScript Form with button from the Java application

Hello Everyone,

I am not too sure on how to exactly word this one out. Anyway, here I go:

I have a form that needs to be validated using JavaScript. Please understand this that the problem is not with the validation logic.

After I’ve tested the form on local machine and on a stand alone server, everything works great! However, when I start loading it to the production server and start to integrate the forms with another application, I hit a snag. The submit button that I created on my form which validate the data becomes useless/conflicted with the button generated by the application.

When the form goes live, the generated submit button uses the Java 7.0 to display the button. How can I edit the Java run button to tie it to my built-in logic for the form validation?

Thanks a bunch!

Can you post an example or link? The server generating the HTML doesn’t matter (Java, PHP, Ruby)…HTML is HTML.

The most likely reason is that either there’s an error in one of the other scripts, or a namespace conflict (for example, jQuery and Prototype trying to use the $ global)

@OzRamos

The script generated by the server is as follow:

    <!DOCTYPE html>
<html>
    <head>
        <title>TEST Access Form</title>
        <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>
        <script>
            function promptUser() { 
                var pmt = document.applets[0].closePrompt(); 
                if (pmt) { 
                    if (confirm(pmt)) {
                        document.applets[0].doClose(); 
                        return true;
                    } 
                    else { 
                        return false; 
                    } 
                    return false; 
                } 
            }
        </script>
    </head>
    <body onbeforeunload="promptUser();" style="overflow-x:hidden; overflow-y:hidden;">
        <script>
            document.write("
                            <APPLET archive='serverformsapplet.jar' code='com.serverforms.forms.applet.ViewerFormApplet' height='100%' width='100%'>
                            <PARAM NAME='code' VALUE='com.serverform.forms.applet.ViewerFormApplet'>
                            <PARAM NAME='java_version' VALUE='1.6* 1.7*'>
                            <PARAM NAME='archive' VALUE='serverformsapplet.jar,languagePack.jar,browserPack.jar'>
                            <PARAM NAME='cache_archive' VALUE='serverformsapplet.jar,languagePack.jar,browserPack.jar'>
                            <PARAM NAME='MAYSCRIPT' VALUE='true'>
                            <PARAM NAME='displayusername' VALUE='ge.washington'>
                            <PARAM NAME='sessionid' VALUE='F337ED6DF147C8AFA54EC9F0AC193990'>
                            <PARAM NAME='safari' VALUE='false'>
                            <PARAM NAME='language' VALUE='en'>
                            <PARAM NAME='saveTextColor' VALUE='0,38,100'>
                            <PARAM NAME='DOB' VALUE='2/22/1732'>
                            <PARAM NAME='clientSideExtraction' VALUE='true'>
                            <PARAM NAME='saveColor' VALUE='206,142,0'>
                            <PARAM NAME='resetColor' VALUE='206,142,0'>
                            <PARAM NAME='UniqueID' VALUE='0001000'>
                            <PARAM NAME='username' VALUE='serverforms'>
                            <PARAM NAME='height' VALUE='100%'>
                            <PARAM NAME='Address2' VALUE=''>
                            <PARAM NAME='Address1' VALUE='1600 Pennsylvania Ave NW'>
                            <PARAM NAME='printVisible' VALUE='false'>
                            <PARAM NAME='Zip' VALUE='20500-1945'>
                            <PARAM NAME='attachmentsTextColor' VALUE='0,38,100'>
                            <PARAM NAME='resetTextColor' VALUE='0,38,100'>
                            <PARAM NAME='WhiteHouseEmail' VALUE='ge.washington@WhiteHouse.gov'>
                            <PARAM NAME='form' VALUE='BasicCoreForm'>
                            <PARAM NAME='width' VALUE='100%'>
                            <PARAM NAME='rdtoken' VALUE='1250260808664'>
                            <PARAM NAME='attachmentsColor' VALUE='206,142,0'>
                            <PARAM NAME='saveText' VALUE='Submit'>
                            <PARAM NAME='COR' VALUE=''>
                            <PARAM NAME='formUrl' VALUE='publicwebform/F337ED6DF147C8AFA54EC9F0AC193990_BasicCoreForm/1250260808664_BasicCoreForm.html'>
                            <PARAM NAME='City' VALUE='Washington'>
                            <PARAM NAME='Name' VALUE='Washington, George'>
                            <PARAM NAME='printTextColor' VALUE='0,38,100'>
                            <PARAM NAME='Email' VALUE='ge.washington@whitehouse.gov'>
                            <PARAM NAME='State' VALUE='DC'>
                            <PARAM NAME='formServlet' VALUE='sf'>
                            <PARAM NAME='barColor' VALUE='206,142,0'>
                            <PARAM NAME='attachmentsVisible' VALUE='false'>
                            <PARAM NAME='success' VALUE='Form Successfully Submitted'>
                            <PARAM NAME='printColor' VALUE='206,142,0'>
                            <PARAM NAME='CORDesc' VALUE=''>
                            </APPLET>");
        </script>
    </body>
</html>

I guess I’ll start with the .jar files to see what can be done there.

Open up the development console (f12 usually)

What is the error message?

1 Like

After a couple of hours of frustration to get to the content of the .jar file, I ended up using Java Decompiler, JD GUI Once I opened the jar file, there were a lot of classes inside of it.

Among them was a class called forms which contains all of the information that I needed. I was able to successfully change and update what I needed to make it work. I must say that it wasn’t easy, but it is working like a charm now.

Thank you very much everyone!

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.