Highlighted

Select or Custom entry Item from Drop-down list as Email subject

Avatar

Guest

14-01-2009

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@xxx.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!

I know the problem it is with the SelectIndex: (DropList1.selectedIndex)but I can't think anything else..

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

Replies

Highlighted

pguerett

15-01-2009

Use the rawValue instead ....when you add a Custom entry you are not really selecting it. So you code would be:



var sub = DropList1.rawValue;
Highlighted
Highlighted

pguerett

15-01-2009

Thats because of th eproperty that you are using. Change the line as I described and the var sub will contain the correct value and then the subject will get populated correctly.