Skip to main content
Participant
July 6, 2016
Question

Why did my submit button work yesterday but it doesn't today?

  • July 6, 2016
  • 1 reply
  • 305 views

The javascript I have made (I have self taught so theres probably a different way I could have done it so be nice haha)  Yesterday my submit button worked.  Today it does not.  Any ideas why this has happened?  All I changed today before testing the form is the font size of the text fields from 12 to Auto and copo and pasted the submit button onto all 4 pages.  ?

var em_subj = {

    "Agent Request": "Agent Request",

    "Service Call": "Service Call",

    "Other": "Other",

}

var v1 = getField("Type of Request").value;

if (v1 != "Off") {

} else {

    app.alert("Please select the Type of Request.", 3);

}

    mailDoc({

        cTo: "marketing@ebm.com.au",

        cSubject: "Brochure Request - " + em_subj[v1].replace(/Other/, " ") + this.getField("Other Type").value + " - " + this.getField("Agent_Code").value + " - " + this.getField("Agent_Name").value,

        cMsg: "Dear Marketing,\n\n" + "Please have the following brochures sent to:\n\n" + this.getField("Agent_Name").value + "\n" + this.getField("Postal_Address").value + "\n" + this.getField("Postal_Address1").value + "\n" + "Attn: " + this.getField("Contact_Name").value + "\n\n" + "RERCDL001 - " + this.getField("RERCDL001").value + "\n" + "RERCA4001 - " + this.getField("RERCA4001").value + this.getField("RERCA4001_Elec").value.replace(/Off/, " ") + "\n" + "RERCA4002 - " + this.getField("RERCA4002").value + this.getField("RERCA4002_Elec").value.replace(/Off/, " ") + "\n" + "RERCA5010 - " + this.getField("RERCA5010").value + this.getField("RERCA5010_Elec").value.replace(/Off/, " ") + "\n" + "RERCCU016 - " + this.getField("RERCCU016").value + this.getField("RERCCU016_Elec").value.replace(/Off/, " ") + "\n" + "RESTDL001 - " + this.getField("RESTDL001").value + "\n" + "RESTA4001 - " + this.getField("RESTA4001_Elec").value.replace(/Off/, " ") + "\nRETCDL001 - " + this.getField("RETCDL001").value + "\n" + "RETCA4001 - " + this.getField("RETCA4001").value + this.getField("RETCA4001_Elec").value.replace(/Off/, " ") + "\n" + "RETCA5002 - " + this.getField("RETCA5002").value + this.getField("RETCA5002_Elec").value.replace(/Off/, " ") + "\n" + "RERCA4038 - " + this.getField("RERCA4038").value + this.getField("RERCA4038_Elec").value.replace(/Off/, " ") + "\n"  + "REMCA4002 - " + this.getField("REMCA4002").value + this.getField("REMCA4002_Elec").value.replace(/Off/, " ") + "\n" + "RERCDL002 - " + this.getField("RERCDL002").value + this.getField("RERCDL002_Elec").value.replace(/Off/, " ") + "\n" + "RERCDL003 - " + this.getField("RERCDL003").value + this.getField("RERCDL003_Elec").value.replace(/Off/, " ") + "\n" + "RERCDL004 - " + this.getField("RERCDL004").value + this.getField("RERCDL004_Elec").value.replace(/Off/, " ") + "\n" + "RERCDL005 - " + this.getField("RERCDL005").value + this.getField("RERCDL005_Elec").value.replace(/Off/, " ") + "\n" + "RERCDL006 - " + this.getField("RERCDL006").value + this.getField("RERCDL006_Elec").value.replace(/Off/, " ") + "\n" + "RERCA4075 - " + this.getField("RERCA4075").value + this.getField("RERCA4075_Elec").value.replace(/Off/, " ") + "\n" + "RERCA4067 - " + this.getField("RERCA4067").value + this.getField("RERCA4067_Elec").value.replace(/Off/, " ") + "\n" + "RERCA4057 - " + this.getField("RERCA4057").value + this.getField("RERCA4057_Elec").value.replace(/Off/, " ") + "\n\n" + "Additional Information - " + this.getField("Notes").value + "\n\n" + "If electronics are required, please send PDF versions to: " + this.getField("Email").value,

    });

This topic has been closed for replies.

1 reply

Karl Heinz  Kremer
Community Expert
Community Expert
July 6, 2016

Are you getting any error messages on the JavaScript console? Anytime some JavaScript is not working as expected, you should bring up the console and check for errors. You can show the console using Ctrl-J or Cmd-J if you have Adobe Acrobat Pro.

Participant
July 6, 2016

I ended up fixing it, I dont know how to delete my question, but thank you for taking the time to reply