Javascript not executing in right order

Avatar

Avatar
Validate 10
Level 2
Jodi1725
Level 2

Likes

6 likes

Total Posts

113 posts

Correct reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 10
Level 2
Jodi1725
Level 2

Likes

6 likes

Total Posts

113 posts

Correct reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 1
View profile
Jodi1725
Level 2

09-06-2015

Hey my great javascript buddies!!!  Okay So I have the following script on a click event:

var oDoc = event.target

Initial.presence = "hidden"

Printinfo.presence = "visible"

oDoc.mailDoc ({

                         bUI:true,

                         cTo: Name.rawvalue

                         cSubject: Hello

                         });

Why when I click the button does the email send first and then the field hide and become visible.  I need them to hide/visible before the form is emailed. 

What is even more weird is that sometimes it works find and other times it doesn't.  And I can't for the life of me figured out what is wrong!

Any help is always extremely appreciated!

Jodi


View Entire Topic

Avatar

Avatar
Validate 10
Level 2
Jodi1725
Level 2

Likes

6 likes

Total Posts

113 posts

Correct reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 10
Level 2
Jodi1725
Level 2

Likes

6 likes

Total Posts

113 posts

Correct reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 1
View profile
Jodi1725
Level 2

15-02-2018

Still doesnt work. the only reason for the condition was so that maybe it would prevent the email from happening before hiding the other fields. 

So I removed the conditions and put the newButton.ExecEvent("click') at the end of all the hiding conditions and it still fires before it hides the fields.