Prompt user to print page

Discussion in 'ASP .Net' started by Brent Burkart, Apr 26, 2005.

  1. I have a web application which consist of a huge form with many
    requiredfieldvalidators. Before the user submits, I want to prompt the
    user to print.

    I have tried to do this with the help of a CustomValidator and
    javascript, but I can't get the CustomValidator to fire.

    Does anyone have a better to approach this or maybe you can point me in
    the right direction as to why my CustomValidator is not working? Here
    is the code.


    <asp:customvalidator id="PrintValidator" runat="server"
    ControlToValidate="PrintResult" ErrorMessage="PrintValidator2"
    Display="Dynamic"
    ClientValidationFunction="validatePrint2"></asp:customvalidator>

    function validatePrint(oSrc,args)
    {
    if (args.value=="True")
    {
    args.isvalid;
    }
    else
    {
    var agree=confirm("If you have not already printed this application,
    please click 'Cancel' and do so. If you already have printed, please
    click 'OK' to submit");
    if (agree)
    return true;
    else
    return false;
    args.isvalid == false;
    }
    }
     
    Brent Burkart, Apr 26, 2005
    #1
    1. Advertisements

  2. Brent Burkart

    TDAVISJR Guest

    TDAVISJR, Apr 26, 2005
    #2
    1. Advertisements

  3. Isn't that handled in the CustomValidator? I have a hidden text box
    that gets populated when the "Print" button is clicked. That text box
    is the control being validated.
     
    Brent Burkart, Apr 26, 2005
    #3
  4. Isn't that handled in the CustomValidator? I have a hidden text box
    that gets populated when the "Print" button is clicked. That text box
    is the control being validated.
     
    Brent Burkart, Apr 26, 2005
    #4
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.