validation error in blogs

Topics: Developer Discussion
Mar 15, 2007 at 1:16 AM
First, wonderful job on the starter kit! I do have a possible issue to report however. When adding a blog entry you have to click "add" twice. The first time it fails telling you that you "Please enter blog post text.". Second time it suceeds. This is from the FKeditor wiki

With ASP.Net, I need to submit twice when using the RequiredFieldValidator in a FCKeditor instance

FCKeditor will not work properly with the Required Field Validator when the "EnableClientScript" property of the validator is set to "true" (default). Due to a limitation in the default validation system, you must set it to "false".

If you want to do client side validation, you must use a Custom Validator instead and provide the appropriate validation function, using the FCKeditor JavaScript API.

So I changed line 19 of "adpost.aspx" to

<asp:RequiredFieldValidator ID="RequiredFieldValidator2" EnableClientScript="False" runat="server" ControlToValidate="txtEntry"
ErrorMessage="Please enter blog post text.">*</asp:RequiredFieldValidator> 
Coordinator
Mar 15, 2007 at 1:32 AM
Thanks for the fix... I was just too lazy to fix it :)
Jun 28, 2007 at 8:41 PM
I ran into this problem as well.

I found this post on how to fix it: http://dev.fckeditor.net/ticket/294

However, I cannot find a fckeditor.cs so I'm not sure it's much help. The problem with the fix proposed by spacegrrl is that it's not informing the user that there was an issue. So the user goes on about her business thinking the record was added successfully.

I'm not sure what the "If you want to do client side validation, you must use a Custom Validator instead and provide the appropriate validation function, using the FCKeditor JavaScript API. " means. I also saw that listed as a solution on several sites, but since it doesn't provide any excamples, it's not terribly helpful. Anyone have any insight into this? I think this is another one of those obnoxious bugs that will take me a freaking week to fix so I'd appreciate any help.

Thanks!
Coordinator
Jun 28, 2007 at 9:45 PM
Server validation works like client validation once you put it in an update panel. This might be fixed in the latest changeset.
Jun 29, 2007 at 1:29 AM
I was too frustrated to see the obvious (albeit kind of dirty) solution:

I changed the on click to this:

If txtEntry.Value = "" Then
RequiredFieldValidator2.IsValid() = "false"
Else
--do the insert code
end if

I'm just not prepared to download the new code since I've been making so many changed to V2.