Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Highlighted
Copper Super Contributor
Posts: 18
Registered: ‎06-16-2009
Accepted Solution

How to Call Java Script Function On Form Change Event?

Hi

 

I want to call a java script function when ever user switches from one record to another record ( while in detail view). So i have written the code in the load event of the detail form(lets say leaddetail form). But the code is only executing on the entire page refresh(when i press F5)not on the every record switch(while in detail view).

 

So, Could any body please help me on this issue.

 

 

Thanks in Advance

 

 

Regards,

Vamsi Inguva

 

Highlighted
Copper Super Contributor
Posts: 18
Registered: ‎06-16-2009

Re: How to Call Java Script Function On Form Change Event?

Hi ,

 

I have got solution to this issue.The issue is  On page load i am trying to dynamically populate the label by using C# code. But it doesn't worked. So i have tried to populate the the same using Java Script. It worked Fine. The below is the code i have used for that purpose.

 

string statevalue = "test"; ( Over here if we want any database field value we can get it  by the statement "Sage.Entity.Interface.IAccount account1 = this.bindingsource.current as Sage.Entity.Interface.IAccount;", "statevalue = account1.userfield1;")

 

ScriptManager.RegisterClientScriptBlock ((Page)HttpContext.Current.Handler, HttpContext.Current.Handler.GetType(), "MyScript1", "document.all.getelementbyid(label1).innerHTML='Current Status: " + statevalue + "';", true);

 

 

 

Regards,

Vamsi Inguva