Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / December 2005

Tip: Looking for answers? Try searching our database.

Modifying Error Message

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ashish - 22 Dec 2005 01:34 GMT
Hi,
I am using a form with multiple views , each view containg multiple data
validations. Instead of the default error message shown by Infopath when
validation error occurs, i want to display a more user friendly message. Can
anyone help me with this. I do not have VS.net.
Andrej - 22 Dec 2005 09:56 GMT
Hi,

you can add datavalidations to your fields in the form.
in the properties dialog of your control "Data" Tab you will find a button
"Datavalidation".
in the datavalidation dialog you can add validations with messages you want.

cu

Andrej

> Hi,
> I am using a form with multiple views , each view containg multiple data
> validations. Instead of the default error message shown by Infopath when
> validation error occurs, i want to display a more user friendly message. Can
> anyone help me with this. I do not have VS.net.
Ashish - 22 Dec 2005 19:04 GMT
I am sorry i didn't phrase my question properly.
I am just using the validation of "Cannot be blank" and nothing else in all
my fields. So when the user submits the form without completing the mandatory
fields an error message pops up which says " InfoPath cannot submit the form
because it contains validation errors....     If you cannot an error in other
views, there might be a problem with form design"
I just want to change this long error message with a smaller one. The users
are not familiar with InfoPath so they dont know what a view means is etc.


> Hi,
>
[quoted text clipped - 12 lines]
> > validation error occurs, i want to display a more user friendly message. Can
> > anyone help me with this. I do not have VS.net.
Andrej - 23 Dec 2005 08:25 GMT
Hi Ashish,

i hope i have a solution for you.
as i wrote before you need to write error messeage for every field which
will be validated as i described before.

to show a better message as infopath do you can use this lines of jscript:

try{  
  if(XDocument.Errors.length!=0) // analyse are there some errors in the form
  {    //show the message of the first error in the form
    XDocument.UI.Alert(XDocument.Errors.Item(0).DetailedErrorMessage);
  }
  else
  {     //submit the form to a database
    XDocument.Submit();
  }
}
catch(ex)
{
    XDocument.UI.Alert(ex.message);
}

put this lines of source in OnClick event of a button.
if there is an error user will see your customized message for the field.
if ther is no errors in the form the form will be submitted.

cu

Andrej

> I am sorry i didn't phrase my question properly.
> I am just using the validation of "Cannot be blank" and nothing else in all
[quoted text clipped - 22 lines]
> > > validation error occurs, i want to display a more user friendly message. Can
> > > anyone help me with this. I do not have VS.net.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.