Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Text field values changing to "true" when I click submit by e-mail button

Avatar

Level 2

I have some logic in my e-mail submit button to determine who needs to receive the form based on information in the form.  Based on my sample code, when I click the submit by e-mail button and TextFiel4.rawValue is D781008CX03, it will actually change the value in TextField4 to "true" when submitting the form.  What can i do to fix this issue?

if

(TextField4.rawValue = "D781008CX03" && CheckBox10.rawValue == true){

var myDoc = event.target;

myDoc.mailDoc(

false,

email_address@yahoo.com

, "", "",

"Request to Add "

+FuelRating.rawValue ,

"You have a new industrial request to add "

+FuelRating.rawValue

);}

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

You are missing a second equal sign in your test for TextField4:

if (TextField4.rawValue == "D781008CX03" && CheckBox10.rawValue == true) {

     // script

}

Hope that helps,

Niall

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Hi,

You are missing a second equal sign in your test for TextField4:

if (TextField4.rawValue == "D781008CX03" && CheckBox10.rawValue == true) {

     // script

}

Hope that helps,

Niall

Avatar

Level 2

Ahhh!!

Amature mistake  .  Thank you for the help and the quick response!!