Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

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

Avatar

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

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

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;

Avatar

15-01-2009

Thanks Paul for your replay.

The problem it is when a user enter custom text the subject appears blank!



Thanks

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

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.