Different validations in a print button -- Urgent !

Hi,
I've adopted the script stated in HightlightOneRequiredField.pdf so that the print button in my form can detect and prevent null field before pop up the print dialog.
However, there's an email field (in my form) with a validate event, i.e. to validate if the email address is in general format "[email protected]", which I want the same print button to check this email validation too (apart from the normal null field checking)
In other words, what I want is that the print button will check:
1) when a null field is detected, then pop up alert message and disable print and;
2) when a field with validate event scripted is detected, and if its validation is not passed, then pop up its existing validation error message, then disable print
Can someone help on this ?
Thanks in advance.
Alex

Hi Alex,
xfa.form.execValidate();
This will check all validations on your form, display the error message for each, and return true or false. True if all validations pass and false otherwise. Use this in your print button to check the validations before printing. So. . .
if (xfa.form.execValidate())
xfa.host.print(yada yada);
A word of caution though. I don't think this is fool-proof. A user can always print using the menu or a shortcut key in Acrobat/Reader, which bypasses your print button.
Hope this helps.
Jared Langdon
www.jlangdon.ca

Similar Messages

  • How do I add a print button that would print out pdf or different version than what is on the site?

    I see this example on NY Times.  If you pick any of their articles and click print or do the short cut (Command-P) ... (Control-P for windows), the layout of their article is completely customized and cleaner.  It seems like they've edited the print look to be different than what you see on the website.
    I find that very cool and something I've bent dying to achieve.  My guess is that I could make a pdf to what I want the print look to be and have a print button read that instead of the website but I don't know, I need help with this.

    I have but it's not what I'm looking for.  I want to edit what the printer will actually print when a reader clicks print.  So if the page has a puzzle, for example, and the reader clicks print.  The printer will print the puzzle in a different location on the page without some of the clutter that's on the site or have some message that's not originally present on the website.

  • Adobe form validation with Print button

    Hi All,
    I have an adobe form with field validation (javascript) already set up but I'm trying to add one more feature to the validation.
    Let me explain my initial validation first:  I have 18 required fields with their tooltip name having an '*' at the end.  Any fields not filled in with this tooltip marker will show up on an alert message when the print button is selected.
    There are two fields called IException and Amount that are required but an End User might have additional IExceptions and corresponding Amounts.  Therefore I have created 5 textboxes for each but only the first IException and Amount are absolutely required (and I use a '*' within their tooltip).  Now if an End User has an additional IExceptions ("IException2") and fills out this field, I need to make it mandatory that "Amount2" would also have to be filled in.
    Here is my code: [code]
    function validateFields()
    var flg = 0
    var n = this.numFields
    var fArr = new Array();
    for(var i = 0;i<n;i++)
    var fn = this.getNthFieldName(i);
    var f = this.getField(fn);
    var tt = f.userName
    if(tt.indexOf('*')!=-1 && f.value == f.defaultValue)
    flg++;
    fArr[fArr.length] = tt;
    if(flg>0)
    app.alert('There are '+flg+' fields that require a value\n\n'+ fArr,3)
    var IException2 = document.getElementById('IException2').value;
    var Amount2 = document.getElementById('Amount2').value;
    if ((IException2.length >0) && (Amount2.length == 0))
    app.alert('Amount is missing')
    else
    document.ExceptionForm1.print();
    validateFields();
    [/code]
    Currently when one of the require fields is NOT filled in, i receive my first alert message.  If all required fields are filled in my print button doesn't work.  Also if all required fields are filled in and IException2 is also filled in but Amount2 is not, I don't receive my second Alert message.  So my code works up to the "Var IException2 = document....." and I don't know what the issue is.
    Thank you for your help in advance. 

    One more question,  since I have 4 of these...I'm having trouble getting the button to do exactly what its suppose to based on what's filled in because i think i have my '{ }' messed up and or IF/ELSE statement is wrong...can you please take a look..
    function validateFields()
    var flg = 0
    var n = this.numFields
    var fArr = new Array();
    for(var i = 0;i<n;i++)
    var fn = this.getNthFieldName(i);
    var f = this.getField(fn);
    var tt = f.userName
    if(tt.indexOf('*')!=-1 && f.value == f.defaultValue)
    flg++;
    fArr[fArr.length] = tt;
    if(flg>0)
    app.alert('There are '+flg+' fields that require a value\n\n'+ fArr,3)
    var a = this.getField('IException2').value;
    var b= this.getField('Amount2').value;
    if ((a.length >0) && (b.length == 0))
    app.alert('Since IException 2 is filled in, Amount 2 is also required')
    var c = this.getField('IException3').value;
    var d= this.getField('Amount3').value;
    if ((c.length >0) && (d.length == 0))
    app.alert('Since IException 3 is filled in, Amount 3 is also required')
    var e = this.getField('IException4').value;
    var f= this.getField('Amount4').value;
    if ((e.length >0) && (f.length == 0))
    app.alert('Since IException 4 is filled in, Amount 4 is also required')
    var g = this.getField('IException5').value;
    var h= this.getField('Amount5').value;
    if ((g.length >0) && (h.length == 0))
    app.alert('Since IException 5 is filled in, Amount 5 is also required')
    else
    this.print();
    validateFields();

  • The Add Printer button on the eprintcenter website on my screen is not working.

    I just registerd on the eprintcenter.com site and now I am trying to click on the +Add Printer button/icon to add my printer and it is not working. I have tried it in all different web browsers and it doesn't take me anywhere on any of the browsers. Sometimes I get the "javascript&colon;void(0)" message down in the left hand bottom portion of my screen when my mouse goes over that button. What is wrong? Is it your site or my computer?

    I'm having same problem

  • How Can I Create a Print Button on a PDF Using Acrobat Pro That Will Also Work on iOS?

    I created a Print Button on a PDF document using Adobe Acrobat Pro on my Mac.  The Print button works perfectly on different browsers on my Mac and on Windows (running under Parallels Desktop) as well.
    When I open the document on my iPad the Print button doesn't even appear.  I am guessing that this is a Flash issue but it may be more related to the fact the the action for the button is to access the Print menu item, which doesn't exist under iOS.
    Is there any way to create a Print button using Acrobat Pro that will work on a Mac and Windows but also on iOS?

    In order to initiate printing by clicking a button, the button has to have either an "execute menu item" type action or use the "print" JavaScript method. As you guessed, the former won't work since there are no menu items to execute, and the latter can only work if the particular PDF viewer you're using supports it. I'm not aware of any that do on iOS.
    The button doesn't appear because you're probably opening it in the default PDF viewer, which doesn't support forms at all. If you were to open the form in Adobe Reader, you'd see the button but it wouldn't work.

  • How to send the ALV GRID output to spool by using the print button in std t

    How to send the ALV GRID output to spool by using the print button in standard tool bar.
    We have created a button in the va02 transaction.  If user click on the button the new screen will be display on that screen we are populating the alv grid output using the oops concept.  But i am unable to send the output to spool using the print button in the standard tool bar.
    I am able to display the Print parameter dialog box but i am not able to send it to spool.
    Kindly help.
    Thanks In Advance.
    G.V.Ramana

    Hi Shaik,
    There is not properties button in my print screen.
    MODULE user_command_0900 INPUT.
        WHEN 'EXCEL'.
          PERFORM excel_download.                              
        WHEN 'PRI'.
          PERFORM print_output.
    form Print_output.
    CALL FUNCTION 'RSPO_LIST_LAYOUT_FITS'
               EXPORTING
                    columns        = 80
                    device         = 'ANY '
                    lines          = 65
                    maxpenality    = 1999
               TABLES
                    layouts        = lt_layouts1
               EXCEPTIONS
                    unknown_device = 1
                    OTHERS         = 2.
          IF sy-subrc = 0.
            LOOP AT lt_layouts1.
              IF lt_layouts1-penality < 1000        AND
                 lt_layouts1-penality < l_min_penality.
                l_layout       = lt_layouts1-layout.
                l_min_penality = lt_layouts1-penality.
              ENDIF.
            ENDLOOP.
            IF NOT l_layout IS INITIAL.
              CALL FUNCTION 'GET_PRINT_PARAMETERS'
                   EXPORTING
                        mode                   = 'CURRENT'
                        line_size              = 80             "#EC *
                new_list_id            = l_new_list_id
                        no_dialog              = l_no_dialog
                        layout                 = l_layout
                   IMPORTING
                        out_archive_parameters = rs_arc_params
                        out_parameters         = rs_pri_params
                        valid                  = l_valid
                   EXCEPTIONS
                        archive_info_not_found = 1
                        invalid_print_params   = 2
                        invalid_archive_params = 3
                        OTHERS                 = 4.
              IF sy-subrc NE 0.                                 " INS SLIN
              ENDIF.                                            " INS SLIN
              IF rs_pri_params-linsz LT 80 OR
                 rs_pri_params-linsz LT gt_stack-s_lprint-width.
                gt_stack-print_line_break = 'X'.
              ELSE.
                CLEAR gt_stack-print_line_break.
              ENDIF.
              IF l_valid NE 'X'.
                rs_pri_params = ls_pri_params_sav.
                rs_arc_params = ls_arc_params_sav.
              ENDIF.
            ENDIF.
          ENDIF.
    endform.                    " Print_output
        CALL METHOD gv_cost_tot_alv_grand->set_table_for_first_display
                EXPORTING
                   is_layout         = gs_layout_cost_tot_grand
                CHANGING
                   it_fieldcatalog   = gt_fcat_cost_tot_grand[]
                   it_outtab         = gt_cost_tot_grand[].
    Please check my code

  • Sharepoint 2010 SSRS Report Viewer Print button not doing anything

    We are having trouble printing reports from report viewer integrated in SharePoint 2010. On IE 11 compatible mode clicking print button does nothing.

    Hi,
    Please test the issue on different browsers and client PCs.
    Did you find any related error message in ULS log or event log?
    If you are recieving the error “Unable to load client print control”, please refer to the link below and see if it can be help:
    http://blogs.msdn.com/b/mariae/archive/2010/04/13/error-unable-to-load-client-print-control-when-printing-reports-in-reporting-services-summary-of-all-possible-causes-at-april-2010.aspx
    Regards,
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected] .
    Rebecca Tu
    TechNet Community Support

  • Acrobat 9 (CS4) Freezes when pressing 'Print' button

    Hi all,
    I am having a problem with Acrobat Pro 9.0.0 in that when I go to print (with any setting/printer etc) selected, the dialog freezes after pressing the 'Print' button. Therefore I must force-quit to start Acrobat again.
    I have tried trashing the preferences, removing Acrobat 9 altogether & re-installing and nothing seems to be helping.
    I have also tried all sorts of different PDF files both created by myself as well as random PDF's from elsewhere.
    What also seems to happen is that the blue 'Print' button pulses while waiting to be pressed and then when pressed goes blue and stops pulsing and that is where it stays frozen.
    Please let me know if you need any more information or details of the configuration I am using.
    ps. I have Acrobat Professional 8.1.3 also installed which works fine including printing.
    Regards,
    Ross

    Hi Mike,
    I do have some startup items;
    EyeTV Helper
    AdobeResourcesSynchroni
    I Love Stars
    GrowlHelperApp
    NikePlusUtil
    EEvent Manager
    EPSON Scanner Monitor
    I don't have any haxies on anything.
    I made a new user account and tried to replicate the problem but it seems to work fine when logged in as a different user which leads me to think it is a preference in my current user>library
    Ross

  • I can't print my document from Pages...the Print Button is down behind the Dock...and I can't click it to Print....healp!

    I can't print my document from Pages...since the Print Button is lodged behind the Dock...What do I do?

    Hi Judith,
    Your Print button should be accessible, of course, but sometimes we can do things to confuse the system and we have to take some action to get out of that situation. This case sometimes arises if we change the resolution of our screen display since opening the app, or if we change the position of something that is set to "stay on top" of the display.
    If the Dock is the problem right now, you could Hide it or Move it to a different edge of the display, to get it out of the way. Settings are in System Preferences, Personal, Dock. I usually have my Dock set to automatically Hide itself, so it's never in the way.
    You could also try Saving, Closing and reopening Pages and see if that resets the location of the Print Dialog. Or, you could  just hit Return rather than clicking on the button.
    Jerry

  • How to Disable Print Button in document.htm?

    Hi,
       I'am using HAP_DOCUMENT BSP applications for Appraisal.I had creatde iViews for that BSP's in Portal and am able to acess all the BSP's.
       I'am using document_created.htm BSP for displaying Created Appraisals and it is working fine.When i click on particular Appraisal mentioned in that iview it will move to next page i..e.,document.htm where we can see the complete description of the Appraisal.Now we had 5 buttons in that page
    Action Log,Exit,Display Scorecard,Disaply Qualifications and Print.
      Now i want to disable Print Button.I searched a lot but am unable to find the exact code written for this Print button.I dnt know much abt the coding of BSP's,please anybody guide me with a solution.
    With Regards
    Praveen

    Instead of disabling the print buttons, you can restrict creating the actual output message for a specific output type.
    You can achieve it by creating the Output Requirement in transaction VOFM. You need to assign this requirement to your Output type. In this Requirement you can check all your conditions. If they all validation pass through than and than create the Output.
    Regards,
    Naimesh Patel

  • How to disable print button in outoput screen from vf03

    hi,
    i have a requirement to display error message and, disable the print and print preview button.
    below its the step,
    1)vf03
    2)key in document type
    3)select output type
    4)if there's error, display error message and disable print and print preview button.
    what i have done was
    1) i've put the error message in my 1st part of code,
    *determine discount
    it_zmas-discount = it_zmas-gross_value - zkwert.
    MODIFY it_zmas.
    ELSE.
    MESSAGE ID 'Z0' TYPE 'S' NUMBER '999' WITH 'Please maintain cust pricing grp 34 for ' wa_zmas-matnr.
    p_proc_screen = 'X'.
    ENDIF.
    CLEAR zknumh.
    2)then i set itcpo-tdpreview = ' ' to display my print button after display the error message
    CLEAR itcpo.
    MOVE-CORRESPONDING nast TO itcpo.
    itcpo-tdcover   = nast-tdocover.
    itcpo-tddest    = nast-ldest.
    itcpo-tddataset = nast-dsnam.
    itcpo-tdsuffix1 = nast-dsuf1.
    itcpo-tdsuffix2 = nast-dsuf2.
    itcpo-tdimmed   = nast-dimme.
    itcpo-tddelete  = nast-delet.
    itcpo-tdcopies  = nast-anzal.
    itcpo-tdprogram = sy-repid.
    IF us_screen NE space
    AND p_var EQ space.
    itcpo-tdpreview = 'X'.
    itcpo-tdnoprint = 'X'.
    ELSE.
    itcpo-tdpreview = ' '.
    ENDIF.
    CASE nast-nacha.
    WHEN '1'.
    xdevice = 'PRINTER'.
    itcpo-tdnewid = 'X'.
    itcpo-tdgetotf = 'X'.
    WHEN '2'.
    xdevice = 'TELEFAX'.
    itcpo-tdtelenum = nast-telfx.
    itcpo-tdteleland = us_country.
    itcpo-tdsenddate = nast-vsdat.
    itcpo-tdsendtime = nast-vsura.
    WHEN '3'.
    xdevice = 'TELETEX'.
    itcpo-tdtelenum = nast-teltx.
    itcpo-tdteleland = us_country.
    itcpo-tdsenddate = nast-vsdat.
    itcpo-tdsendtime = nast-vsura.
    3) my last problem its, i am not sure how to disable the print button.i need  to show an error message for my invoice via vf03 when error occur when user click print or print preview button. however with my code above, i am only able to display the error message and disable the print preview.
    could anyone guide me how do i disable my print button? really appreciate your help.
    regards,
    sw

    Instead of disabling the print buttons, you can restrict creating the actual output message for a specific output type.
    You can achieve it by creating the Output Requirement in transaction VOFM. You need to assign this requirement to your Output type. In this Requirement you can check all your conditions. If they all validation pass through than and than create the Output.
    Regards,
    Naimesh Patel

  • Print Button window Crashed in IE8 browser using SAP EP7.0

    Hi,
    I have to logon to CRM B2b application in SAP EP7.0 , in B2B application in any print Button click on Print button window is displaying in another window,  after few seconds  the IE8 browser is closed
    Error Message
    "Internet Explorer has closed this webpage to help protect your computer
    A malfunctioning or malicious add-on has caused Internet Explorer to close this webpage. "
    But print button click on IE8 window closed it  comes only SAP Enetrpriseportal
    Please give me any suggestions.
    Thanks
    srini

    Hi Joerg
    did you see NWBC Web GRC v10 WSOD
    The comments in there imply it's an issue with IE8. Have you been able to try a different browser? There is a reference to specific IE8 note
    Regards
    Colleen

  • Sales Deal with two different validation dates for the same material

    Hi SAPers,
    I am trying to create a u201CSales Dealu201D VB31, for the same material/condition, but with two different validation dates. After the creation of the first record, I select u201CNew conditionu201D button, but the system give me the message VK104, u201Cthe condition is being processed in the current session.u201D.
    How can I solve this issue?
    Thanks in advance.
    Pedro

    We can't have multiple records for the same condition and key values valid on the same date. The condition end date is part of the primary key in the database table. The date ranges between the records cannot overlap. When you create a new record, usually the end date is set to 12/31/9999 by default. If you need to have this deal to end on a different date and a new deal to start afterwards, then first you need to change 12/31/9999 to a different date.
    Also usually I try to exit the screen between the transactions.

  • Question about print button

    Good morning everyone,
    Quick question for you this morning, im playing around with the print button and so far i get it to do what i want. Which is basically print in "FIT" mode like this:
    xfa.host.print(1, "0", (xfa.host.numPages -1).toString(), 0, 1, 0, 0, 0);
    now this takes care of people who press my custom print button, but i dont have control over the folks that might activate that from the print icon or from the print menu options.
    Now for this i know that using PRE:PRINT would solve it for sure, but i dont know how to write the code in there so it works.
    What i did at first is copy the print code above in that section, but if i press my Print button where the same code is, i create a endless loop.
    Im just trying to cover my self and make sure that what ever one of the 3 print choices they choose, i will be able to execute the code above and without any infinite loops
    Any ideas how i could set this up?
    Thank you very much again!!!

    Hi,
    you can disallow printing form the menu items or key combination with a bit of scripting.
    But first you need a variable you add under the form properties with a default value like 0.
    Lets name it "usedPrintButton".
    Ok, now the scripting part.
    There are 3 scripts in 3 different events neccassary. You can use all those events of your print button.
    1. click event
    // Modify the variable to imply user has started printing from this button
    usedPrintButton.value = "1";
    xfa.host.print(1, "0", (xfa.host.numPages -1).toString(), 0, 1, 0, 0, 0);
    2. prePrint event
    // Check the variable and cancel printing when it's 0
    if (usedPrintButton.value == "0") {
              xfa.event.cancelAction = true;
    3. postPrint event
    // Set the variable back to 0
    usedPrintButton.value = "0";
    Hope this helps.

  • Print Button issue... Acrobat won't print

    We have one particular machine here at work where Acrobat will not print. You can bring up the Print dialogue box and change all the print settings, but when it comes time to actually print the document, it's like the "Print" button does not work. It is highlighted, but just does not depress. Hitting Enter does not work either. We've tried installing different versions of Acrobat and Acrobat Reader, and the same thing happens, yet other Adobe applications print without issue. OS is Tiger. We've tried Acrobat 6, 7, and Reader 8 & 9.
    Is there a preference I could kill which might reset this?

    Just saw your post. I've been having similar problems. I've reinstalled the printer, reset the printing system, and still had problems. However, it SEEMS as if I've had some success when I do a "page setup" in Acrobat before going to the print command. Let me know if this helps you.

Maybe you are looking for

  • Mighty Mouse button doesn't work in Login screen.

    When I boot up my Mac I can move the cursor with the mouse in the Login screen, but I can't click on anything - the buttons don't work. Once I'm logged in the mouse works normally in every way. This only happens with the Mighty Mouse - 3rd party mice

  • Role based access control

    Hello ,  Is there a RBAC in Windows 2012 R2?

  • Help with Aperture 1.5 & OSX Snow Leopard

    Using iMac w/intel core 2 Duo, 1GB RAM, over 100GB of HD left. Just upgraded to Snow leopard, getting ready to move up to LION (after I get an additional 1GB of RAM). Discovered my Apert. 1.5 can not be used with OSx SL 10.6.8 and need Apert.2. or 3.

  • SRA gateway - performance problems

    Hi! I'm experiencing slow response with SRA gateway when I stress the home page in a site www.example.com. I redirected the SRA default home page to a custom application home page. In my deployment, I have one machine with SRA 2005Q1 and my applicati

  • Problems with Frequency analysis

    I use the frequency analysis a lot for comparing specific points on similar tracks.  Every once in a while, the freq anal will stop live-updating.  In fact, it will not register a changing in the cursor position on the edit or spectral freq view at a