Try our conversational search powered by Generative AI!

Add logic to the edit mode interface

Vote:
 
In one of the page types I would like to add some logic in the edit mode. I want the publish stop date to be mandatory if a certain check box not has been ticked. If the check box has been ticked the publish stop date is not mandatory. Does anybody know how to do this? The reason for doing this is that we want to avoid information that is out of date. The publisher will be forced to consider whether the page will be out of date someday or if the information will be valid forever (the check box will be ticked if the information should be valid forever). I was thinking of catching the global SavePage event, but then the page will be saved even if the stop publish date has been negelected (and no check box ticked), since my event handler has been preceeded by another one. I am thinking of adding a javascript. But I do not know how to add it only to the edit mode. Any ideas anyone? Thank you. Best Regards /Sofia
#12277
May 11, 2005 10:44
Vote:
 
If you mean the DataFactory.SavingPage, I don't see why this shouldn't help you. When saving the page, in this event you can check if the page's check box has been ticked, and if so, check whether the StopPublish property is set. If not, you can do a CancelAction. See the SDK under Datafactory class events for more information. Frank :)
#13956
May 11, 2005 12:42
Vote:
 
Can you use the following example where you can validate the page before it's saved: http://www.episerver.com/templates/CommunitySample____2630.aspx Frode
#13957
May 12, 2005 9:38
Vote:
 
Thank you very much Frode. Exactly what I was looking for! Can I do anything for you? :) /Sofia
#13958
Jun 15, 2005 10:35
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.