Able to Send report with blank 'Data Required' field - InfoPath Dev
in

InfoPath Dev

Able to Send report with blank 'Data Required' field

Last post 09-05-2011 10:42 AM by Patrick Halstead. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 08-31-2011 12:35 PM

    • Ricky
    • Not Ranked
    • Joined on 08-31-2011
    • Posts 5

    Able to Send report with blank 'Data Required' field

     Hi all,

    I have a report created via Infopath 2003 with some Text Boxes that have the "Cannot be blank" boxes checked (I have even added some data validation that stated if the field is blank then show an error alert). However, when I send the form I just receive a message that states: "This form contain validation errors. Errors are marked with either a red asterisk (required fields) or a red, dashed border (invalid values). Do you still want to send it? Yes  No"

    I don't want the user to have the 'yes' or 'no' option.

    I have two levels of submitting.

    1) A 'Submit' button with code to bring up an Outlook style envelope. (ctlSubmit function)

    2) In that envelope is a 'Send' button beside the 'To' field.

    After step 2 is when I'm receiving the message. 

     

    How can I make it so that the user must fill in the required fields? Any help is greatly appreciated.

     

    This is my 'Submit' button code:

     function ctlSubmit::OnClick(eventObj)

    { try { var oEnvelope = Application.ActiveWindow.MailEnvelope;

    var objReport = XDocument.DOM.selectSingleNode("//my:myFields/my:report_name_blank");

    //var objRequestor = XDocument.DOM.selectSingleNode("/my:myFields/my:Request_By");

    oEnvelope.Subject = "Data Request - " + objReport.text; oEnvelope.To = "[email protected]"

    oEnvelope.Visible = true;

    } catch(ex)

    { XDocument.UI.Alert(ex.description); } }

     

  • 09-05-2011 10:42 AM In reply to

    Re: Able to Send report with blank 'Data Required' field

    Hi Ricky,

    The reason you are able to send it is because your code doesn't check. If you get rid of the code and just use out-of-box rules and submit data connection, it will prevent submits if data is missing.

    The File->Save event, on the other hand, allows saving even if the form has validation errors.

    Remove the code. Add an email submit data connection. Configure submit options. That should ne all that is required.

    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.