I appreicate the help. Below is a section of the form where I currently have check boxes.
I want to move to radio button so that only 1 can be selected.
The javascript works with check boxes.
I'm looking to see how I can capture the value of the selected radio button
radio group shipping
radio1 Choice Non-Emergency Parts Order
radio 2 Choice Standard Overnight
radio 3 Choice Priority Overnight
radio 4 Choice 2nd Day Air

Summary:
Change check box to radio button option so people can only select one. I still want the form to show a checkbox.
Radio button names
Non-Emergency Parts Order
Standard Overnight
Priority Overnight
2nd Day Air
For the subject in the email:
If the radio button selected is: [Non-Emergency Parts Order]
Subject will read “D [district #] [customer name] SR [number]”
If the radio button selected is any of the other three:
Standard Overnight
Priority Overnight
2nd Day Air
Subject will read “ !!Rush - D [district #] [customer name] SR [number]”
Thank for taking the time to explain your project.
Now that you broke it down like that it was a lot easier to figure this all out.
What I did in the form was to implement a Button with a JavaScript Mouse-up action event.
I also spotted some errors on you spelled one of the variables for the customer name field.
The variable had a sapce "customer name" and this is probably why the original script wasn't loading the emailing part, so I renamed it to "customerName".
This is the script that is working on my end, and I am also attaching a copy of the PDF so you can test and see how all the field objects interact with each other:
// DECLARE THE VARIABLES
var EmerText = "Non-Emergency Parts Order";
var ship = this.getField("shipping");
var district = this.getField("district").valueAsString;
var customerName = this.getField("customer name").valueAsString;
var serialNum = this.getField("SR number").valueAsString;
var toAddress = "email1@email.com; second email2@email.com";
var ccAddress = "317swwwervice@email.com; marlo.thom@email.com; scott.bdsdwe@dft.com";
var msgBody = this.getField("shipping").value + " Please Order";
// ESTABLISH AN IF / ELSE / IF CONDITION
if (ship.value == EmerText) {
this.mailDoc({cTo: toAddress, cCc: ccAddress, cSubject: "D "+"["+district+"] "+"["+ customerName+"] "+"["+serialNum+"]", cMsg:"D "+ msgBody})
this.calculateNow();
} else {
if (ship.value !== EmerText) {
this.mailDoc({cTo: toAddress, cCc: ccAddress, cSubject: "!!Rush - D "+"["+district+"] "+"["+ customerName+"] "+"["+serialNum+"]", cMsg: "!!Rush - D "+msgBody})
this.calculateNow();
}
}
Here's a copy of the file: Parts Order Template Test PDF
NOTE: You may want to add an additional button to reset the form or just the radio buttons.