Answered
Hi everyone,
from the forum I found and I use the script below on a click event to email my form:
var myDoc = event.target;
var address = "xxxx [at] xxx [dot] org";
var sub = DropList1.getDisplayItem(DropList1.selectedIndex);
var msgBody = "Hello";
myDoc.mailDoc({
bUI: false,
cTo: address,
cSubject: sub,
cMsg: msgBody,
cSubmitAs: "PDF"
});
It's work fine but does not work properly when a user ENTER CUSTOM TEXT into the DropList1!
Subject line appears to be empty when we click the EmailForm button!
My Drop-Down list box includes also export values.
On the subject line I want to appear ONLY the select or entry Item.
How I can solve the above?
Thanks again
So if they select something from the index, you're fine, but once something custom is entered, it's really no longer a selected index.
I've never done this, but would DropList1.rawValue need to be referenced if it was entered custom? If so, then you would need to somehow have the form able to grab one or the other. You could try experimenting with if statements or try concatenating the rawValue with selectedIndex, so that it always reports really only one, but always something.
Looks good on paper.