Required Text Fields - InfoPath Dev
in

InfoPath Dev

Required Text Fields

Last post 12-16-2008 04:50 PM by warrtalon. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 12-11-2008 12:04 PM

    Required Text Fields

    I have a required textbox field on my form. Set the property  "Cannot be blank". When I run the form and try and save it, a dialog box pops up and tells me about the required field. And that's all fine and dandy. However, the form is still able to be saved. That's not fine and dandy. Is there a way to prevent the form from being saved until the user enters the a value into the required field?

  • 12-11-2008 01:26 PM In reply to

    In Data Validation, add the condition of the text box being empty and throw an error.

  • 12-11-2008 01:30 PM In reply to

    Hello,

    How are you submitting the form? i.e. is it via email, via a web service, etc. Data validation on your fields is one option, as mentioned above, but I wonder how you are submitting (though you say saving?) because, for example, an email submit will not happen if there is a required field left blank.

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 12-11-2008 01:41 PM In reply to

    The form is browser enabled, and the save button appears at the top of the form. The user can select "save", the dialog box appears with the warning asking if you want to continue to save ( despite the validation errors). If you say yes, the data from the form gets saved to the Doc library. I don't want that. I want to dis-allow the data from being "saved" to the doc library until the user enters some text into the text box. Does that make sense?
  • 12-11-2008 01:46 PM In reply to

    shivajidatta:

    In Data Validation, add the condition of the text box being empty and throw an error.

    How in the blazes do you do that?  All I see is to set a condition if the field is blank.. and then a error message is displayed. That doesn't get me anywhere because the user can still "save" the data to the doc library.  If you ment like throw an exception...I understand. I'm not using any code behind. It's just a simple form "out of the box" sort of thing.

     

  • 12-11-2008 02:03 PM In reply to

    If it is a Button that you are clicking to save the form, you can do Conditional Formatting to disable the button till the text box is populated.  Go to the button properties and click on Display > Conditional formatting.

  • 12-11-2008 02:47 PM In reply to

    shivajidatta:

    If it is a Button that you are clicking to save the form, you can do Conditional Formatting to disable the button till the text box is populated.  Go to the button properties and click on Display > Conditional formatting.

    That's just it, there are no buttons on the form I designed. The Form is published to a MOSS 2007 Doc library. The Form is
    web browser enabled, The MOSS servers Form Services provides a "Save" "Save As"  "Close" and "Submit" buttons when my form is rendered to the client via a web browswer. I understand what you're saying. Placing a button on the form to "submit". I was trying to keep it rather simple, and frankly wanted to see the capablitlies of Infopath in the "out of the box" mode with out getting into "code behind", You see what I'm saying?

  • 12-11-2008 02:51 PM In reply to

    You can go to Form Options to remove the Save and Save As icons in the toolbar (see screenshot)

    Of course, that means that you'll need a button that is configured to submit your form. Then you can place rules/validation and can avoid the Save/Save As toolbar functionality.


    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 12-11-2008 02:56 PM In reply to

    ErnestoM:

    You can go to Form Options to remove the Save and Save As icons in the toolbar (see screenshot)

    Of course, that means that you'll need a button that is configured to submit your form. Then you can place rules/validation and can avoid the Save/Save As toolbar functionality.

    So in other words, to get the functionality I want, I have put a button on my form, get into the "code behind" and programmaticaly ( to whatever extent ) do this stuff. And that's cool.. I suppose..lol

     Was hoping the designer and capablities was such that I didn't have to go there. Oh well...

     

  • 12-16-2008 04:50 PM In reply to

    Well, you are receiving these suggestions, because you are experiencing something that shouldn't happen.  In all of my forms, if data validation is not met (blank field that is set to "cannot be blank" or custom data validation that is not met), then I am unable to submit or save to the library.  I have never experienced what you are seeing.  However, it is also true that I hate using the Save button, because that lets the user pick a file name, and I don't like that.  I almost always use a custom control button with rules behind it that save the file and provide a unique filename dynamically generated using the now() function to ensure all filenames are unique and so that I can easily overwrite the file upon a later submit without it creating a new file.

    Nothing mentioned above requires any amount of code - just basic GUI configuration with rules and data connections.

Page 1 of 1 (10 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.