Validating blank field - InfoPath Dev
in

InfoPath Dev

Validating blank field

Last post 04-16-2010 06:05 AM by casiviani. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 04-15-2010 09:45 AM

    Validating blank field

    Hello, this my first time working with Infopath and I have to do some validation for some task...

    My Form works with a datasource for receive and send information about employees, for receive info I placed the IDEmployee as query field... with this I have a trouble.... when I don't type anything on the Control (IDEmployee is blank) and clic the "Run Query" button (this is configured as Infopath did) I want to validate that field before to execute, because when it Execute without parameters it returns all the fields from the database... this an example.

     

    Employee ID:___   (In the textbox its assigned to the @IDEmployee query field as it's displayed)

    Employee Name:___ (This should show the Employee name after execute the search using the @IDEmployee)

     

    the case is, if the Employee Id TextBox(@IDEmployee) its blank and I click on "Search" butto i need to to fire some message like "Please write an Employee ID." and cancel the execution of the button.

     

    please, if some one have any idea about this case... help me =(

     

    note that the button doesn't have custom code, i run the query or consult by the default execution for that button as the submit case.

     

    thanks

  • 04-15-2010 10:16 PM In reply to

    you can do two things to avoid this.

    1) use conditional formatting to hide the query button if IDEmployee is blank.

      right click on the query button-> click conditional formatting. -> add new

     if IDEmployee is blank

    disable/hide the field

    2) Set rules on the query button, to prevent actual querying if IDEmployee is blank.

    right clik on the query button and a rule

    if IDEmployee is blank

    Set  value of field error_label -> Cannot be blank

    check stop processing rules when this rule finishes.

    on second rule do the actual querying

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 04-16-2010 06:05 AM In reply to

     Thanks !! I used the second option and it works great!!!

     

    =)

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