Mike Cundall
New Member Posts:9
|
04/16/2012 5:35 PM |
|
Hi, The document title is currently the only mandatory field during the upload process. Is it possible to make other fields mandatory so users have to add content? For example keywords, description, categories etc. I have managed to get keywords to be mandatory by manually adding an asp.net required field validator to the control but cannot do this for the other fields as they appear to be implemented with custom controls. Also, I have some custom fields and would like to make these mandatory as well but whenever I select the "Required?" box in the "Global Properties" settings (It is of field type 'Select') I get the following exception on the upload page: An error has occurred.DotNetNuke.Services.Exceptions.PageLoadException: Unable to find control id 'ctrl2' referenced by the 'ControlToValidate' property of ''. ---> System.Web.HttpException: Unable to find control id 'ctrl2' referenced by the 'ControlToValidate' property of ''. Any help would be much appreciated. Regards, Mike Cundall. |
|
|
|
|
Peter Donker
Veteran Member Posts:4536
|
04/19/2012 6:08 PM |
|
Hi Mike, Indeed there are a couple of caveats. Some fields will work, but not all. Remarks can't be done. But you've already found the Metadata ascx to edit. Not much to add to that. I'll make a note of the select/required issue you found and try to replicate/fix. Peter |
|
|
|
|
Mike Cundall
New Member Posts:9
|
04/23/2012 3:45 PM |
|
Hi Peter, Thanks for your prompt response. We have implemented some custom JavaScript to perform this validation based on your reply. Regards, Mike. |
|
|
|
|
Peter Donker
Veteran Member Posts:4536
|
04/24/2012 11:33 PM |
|
Mike, What version of DMX is it that you're using? I couldn't replicate on the latest version. Peter |
|
|
|
|
Stuart Hilbert
New Member Posts:39
|
04/30/2012 7:40 PM |
|
I am also getting the "select required" error as mentioned above in version 6.0.2. stuart |
|
|
|
|
Stuart Hilbert
New Member Posts:39
|
04/30/2012 8:26 PM |
|
I think I have figured out what the error is: In the customattributes.vb I moved line 319: tc.Controls.Add(dd) above line 308: If Common.GetABoolean(att.Attribute.Required) And att.Applies Then What is happening is that if the field is required when you get to line 317: tc.Controls.Add(rfv) The control to validate isn't valid because you haven't added the select to the control stack yet. Hope this helps, Stuart
|
|
|
|
|
Peter Donker
Veteran Member Posts:4536
|
05/01/2012 10:31 AM |
|
Thanks Stuart, great catch. I'm updating the code! Peter |
|
|
|
|
Stacy
New Member Posts:10
|
09/10/2012 5:21 PM |
|
Stuart could you possible share how you made the meta fields mandatory. I need the Author Field to be mandatory. Thanks! |
|
|
|
|
Stuart Hilbert
New Member Posts:39
|
09/10/2012 6:06 PM |
|
The meta-data field you are speaking of is an out of the box field, which is different from what this thread was about. However, a long time ago I did what you are asking about. I believe I modifed the .ascx control for the meta data fields and added a required field validator to it. I can't remember if that was everything or if I had to force validation on the "next" button. Stuart |
|
|
|
|
Stacy
New Member Posts:10
|
09/10/2012 6:19 PM |
|
Thanks for the reply Stuart! Have a good week! |
|
|
|
|
Peter Donker
Veteran Member Posts:4536
|
09/12/2012 4:09 PM |
|
As Stuart said: you can adapt the ascx yourself for that. It is called EditCoreMetaData.ascx. Peter |
|
|
|
|