Submit and Print Button

Avatar

Avatar
Level 2
_Win_Lam_
Level 2

Likes

0 likes

Total Posts

33 posts

Correct reply

0 solutions
View profile

Avatar
Level 2
_Win_Lam_
Level 2

Likes

0 likes

Total Posts

33 posts

Correct reply

0 solutions
View profile
_Win_Lam_
Level 2

25-11-2008

Hi,



May i know how do i post a "Print" script into an existing submit button sharing the same principles to validate mandatory fields?



So once a User clicks on the submit and print button, fields will be validated, printing will be triggered without having to display the print window and the email functioning as per normal?



please help. Thanks.

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

25-11-2008

You will need to hide the submit and print buttons.



Then create a new regulat button. On the click evnt of the new button you would cause the other two buttons to be pushed. Something like this:



SubmitButtonName.execEvent("click");

PrintButtonName.execEvent("click");

Avatar

Avatar
Level 2
_Win_Lam_
Level 2

Likes

0 likes

Total Posts

33 posts

Correct reply

0 solutions
View profile

Avatar
Level 2
_Win_Lam_
Level 2

Likes

0 likes

Total Posts

33 posts

Correct reply

0 solutions
View profile
_Win_Lam_
Level 2

25-11-2008

Hi Paul, thanks for the advice.



The submit button will validate and prompt users that there are mandatory fields not filled in, will the print button works the same too?



Can i also print straightaway without having to show the print window?

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

26-11-2008

By doing the submit 1st the validations will run before the print. I believe that if you pass all of the needed options in teh print command that you can print without that dialog but I am not 100% sure.

Avatar

Avatar
Level 2
_Win_Lam_
Level 2

Likes

0 likes

Total Posts

33 posts

Correct reply

0 solutions
View profile

Avatar
Level 2
_Win_Lam_
Level 2

Likes

0 likes

Total Posts

33 posts

Correct reply

0 solutions
View profile
_Win_Lam_
Level 2

26-11-2008

Thanks, Paul. I managed with a validation dcript on the print button.

Avatar

19-12-2008

Pardon me for being the least familiar with this product, but I am in need of this same button action (submit only to validate required fields, and the trigger the print).

Paul - would you kindly give me more remedial instruction as to how to program the regular button to complete both tasks?

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

19-12-2008

The technique woudl be to have a print button and a submit button on the form doing their normal functions - then hiding thise buttons (making them hidden). Then adding a 3rd normal button (this will allow you to program on the click event) then writing code that will do something like this:



//Run validations

if (form1.execValidate()){

execute print command

execute submit command

} else {

app.alert("Validations failed");

}