locked
RequiredFieldValidator skipped on custom NewForm.aspx without Error RRS feed

  • Question

  • I have a Sharepoint 2007 Custom List to track user requests for enhancements to supported programs within our company.  This list does not contain any document storage and is solely for tracking requests from submission to production.  Using Sharepoint Designer 2007 I have created a custom NewForm.aspx where I have changed the some of the MultiLine Form Fields to asp:TextBox so that I can apply a textcounter to prevent users from submtting over 2000 characters.  On fields that are also required, I have applied an asp:RequiredFieldValidator to ensure that users do not skip a field when submitting a new request to be tracked.  All of this has been working beautifully until late last week when a user was able to submit a request where one of these fields was omitted, and they do not remember receiving an error or the ErrorMessage from the validator.

    Does anyone have any ideas why this may have occurred?

    <td width="400px" valign="top" class="ms-formbody">
    							<asp:TextBox runat="server" id="ff4{$Pos}" text="{@Description}" textmode="MultiLine" __designer:bind="{ddwrt:DataBind('i',concat('ff4',$Pos),'Text','TextChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Description')}" onKeyDown="textCounter(this,countdown1,2000);" onKeyUp="textCounter(this,countdown1,2000);" onPaste="textCounter(this,countdown1,2000);" Rows="6" Width="400px" Font-Names="Verdana" Font-Size="8pt" ToolTip="Detail Description" /><br />
    							
    							<SharePoint:FieldDescription runat="server" id="ff4description{$Pos}" FieldName="Description" ControlMode="New" /><br /><asp:RequiredFieldValidator runat="server" ErrorMessage="You must specify a value for this required field." id="RequiredFieldValidator1" ControlToValidate="ff4_1" /></td>


    One other tidbit that may be of use is that I am also using a Form Action button which when clicked performs a Submit then a redirect to a secondary form where the user can then submit additional information on their request.  In case you need to see that as well, here is the code for it:

    <td width="99%" class="style1" nowrap=""><IMG SRC="/_layouts/images/blank.gif" width="1" height="18"/>
    						<input type="button" value="Submit and go to Next Step" name="btnFormAction" onclick="javascript: {ddwrt:GenFireServerEvent('__commit;__redirect={GetLastID.aspx?RedirectURL=CustomEditForm.aspx}')}" style="font-size: 8pt; font-family: tahoma; padding-top: 0.1em; padding-bottom: 0.4em; height: 2.1em;" />
    						<input type="button" value="Cancel" name="btnFormAction0" onclick="javascript: {ddwrt:GenFireServerEvent('__cancel;__redirect={https://www.website.com/default.aspx}')}" style="font-size: 8pt; font-family: tahoma; padding-top: 0.1em; padding-bottom: 0.4em; height: 2.1em; width: 7.5em;"/></td>

    You may notice that the redirect goes to a GetLastID.aspx and then is redirected to the CustomEditForm.aspx, this is so that when the CustomEditForm.aspx it has the new request's ID to sync up the additional information.  The GetLastID.aspx is simply a blank webpage in between the New and Edit pages to capture the new request information and then display the additional fields that can be updated at that point.

    All users in our company are running Windows 7 and we are on Sharepoint 2007 if that helps.

    Any help on determining why this may have occurred would be greatly appreciated.  Thanks!

    Tuesday, March 20, 2012 12:50 PM

Answers

  • I was reviewing my open threads and noticed this entry.  I don't recall if there was anything done to this section of my NewForms.aspx, but I am no longer having the issue I described previously.  The only other information that I did not provide previously was the asp:RequiredFieldValidator code, so I have included it below in case anyone else can benefit from it.

    <asp:RequiredFieldValidator runat="server" ErrorMessage="You must specify a value for this required field." id="RequiredFieldValidator1" ControlToValidate="ff4_1" SetFocusOnError="True" />
    So, I will mark this question as answered.
    • Marked as answer by GopherKing Monday, July 9, 2012 5:44 PM
    Monday, July 9, 2012 5:44 PM