Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Toggle between custom EditForm and OOTB EditForm

  Asked By: Janet    Date: Feb 03    Category: Sharepoint    Views: 1692

I wanted to use a custom EditForm to display a number of fields are READ-ONLY...
but I would also like my "administators" to have edit access to these fields.

Therefore I add a little script with a button that (I thought) would toggle
between the two forms. The good news is that it worked with I opened the pages
from SharePoint Designer, the bad news is that it didn't work from the list. It
seems to want to "redirect" but ends up with the default page anyway. Any
suggestions?

script type="text/javascript">
function RedirectBrowser()
{

var CurrentURL = location.href;
var ReplaceURL = CurrentURL.replace("EditForm.aspx","CustomForm.aspx");

window.location = ReplaceURL;
}
</script>

<input type="button" onclick="RedirectBrowser()" value="Change Form"
align="right" class=ms-ButtonHeightWidth >

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Narasimha Kamane     Answered On: Feb 03

The only way I've seen this work  is by creating a separate administrative
editform somewhere else in the site and then securing it. You can then pass
a parameter to the form to designate which record is to be edited. There is
code in the list  views that will force you back to the default  editform.aspx
for the list if that is where you started. So if you start from the
editform in the list you won't be able to switch to a different editform.

 
Didn't find what you were looking for? Find more on Toggle between custom EditForm and OOTB EditForm Or get search suggestion and latest updates.




Tagged: