- This topic is empty.
- AuthorPosts
-
- 03/07/2011 at 9:38 am #4816
AnonymousParticipantHi ,
When a required field has no data we display in red the message "Required!" next to the field. This is the default behavior.
You can add a popup message if you create a custom action based on the code sample we supply installation folder of the product (…\program
files\Quest Software\in the Quest Web Parts for Sharepoint xxx).
Open the solution using Visual Studio, go to the pleCustomActionsAndCustomLayouts project and open the file pleCustomActionEx.cs.
In the Perform method you need to do something like this
if (item != null)
{
if (item["CityID"] != null)
{
evt.Cancel =
true;
evt.Message =
"CityID can't be empty";
}
}
And that will popup the message you can see it in the below. Please not thet the CityID in my list is not a required field.
If you have nay questions please let me know.
- 03/29/2011 at 9:48 am #3973
AnonymousParticipantHi,
Is it possible to have a popup when the user click ‘Save’ but the required fields have not been filled out?
Thanks,
.
- 03/29/2011 at 9:48 am #4808
AnonymousParticipantThe "Required When" behavior can be achieved without coding a custom action. In QWP 5.4.1, you can create a form component behavior that will check the value of one field (e.g., check if the field is null) and make another field required. For example, the form component xml behavior below is placed on the "Contact Type" field. If the Status field is equal to behind, then the Contact Type field can not be null which makes the field required. When Contact Type is null and the user clicks the Save button, then the user sees the message,"Contact Type is required when Status is Behind".
<FormComponentBehavior>
<Component Type="Field" ID="Contact Type">
<RequiredWhen Message="Contact Type is required when Status is Behind">
<Eq>
<FieldRef Name="Status" />
<Value Type="Text">Behind</Value>
</Eq>
</RequiredWhen>
</Component>
</FormComponentBehavior>
Curtis
-
- AuthorPosts
You must be logged in to reply to this topic.