Difference between revisions of "Change owner script"

From SmartWiki
Jump to: navigation, search
 
(One intermediate revision by the same user not shown)
Line 14: Line 14:
 
In this example the 'stageid' represents the status in this case its 'web' status. It will then change the ownerid to the current person editing it. The owner id can be hard coded to represent a constant contact by putting 'frm.ownerid.value=userid'. Where userid='actual userid' for the user.
 
In this example the 'stageid' represents the status in this case its 'web' status. It will then change the ownerid to the current person editing it. The owner id can be hard coded to represent a constant contact by putting 'frm.ownerid.value=userid'. Where userid='actual userid' for the user.
  
[[Category:Browser Scripts]][[Category:JavaScript Examples]]
+
[[Category:JavaScript]]

Latest revision as of 09:57, 31 July 2009

Change Owner Browser Script

Use this browser script to force the owner to the person editing the level one as per the status.

 function changeOwner(){
 var frm=document.form1;
 if (frm.stageid.value=='1829')
   {
      frm.ownerid.value=@me.userid@;   
   }
 }
 changeOwner();

In this example the 'stageid' represents the status in this case its 'web' status. It will then change the ownerid to the current person editing it. The owner id can be hard coded to represent a constant contact by putting 'frm.ownerid.value=userid'. Where userid='actual userid' for the user.