kalu singh rao

kalu singh rao

  • 288
  • 6.4k
  • 108.9k

how to use one function value outside in another function

Oct 16 2014 12:47 AM
I have two function like below. I want to use one function value in second function. But i am confuse about it how can i use ? I have googled but not get right solution. one function have value like as 11,12,13,14,15.
 
 
global variable:-
 
var  CatValue, Rvalue, BranchVal; 
 
one function :-
 
function UserData() {
Rvalue = $('#<%=ddlScheme.ClientID%>').val();
Rvalue = Rvalue + ',';
BranchVal = Rvalue;
}
 
second function:-
 
function insertCat() {
UserData();
var y = BranchVal;
this.sOpt = $("#<%=ddlOption.ClientID%>").val();
this.SerialNo = SerialNo ? SerialNo : 0;
this.CodeName = $("#<%=txtCodeName.ClientID%>").val();
this.ParentID = $("#<%=ddlSubCategory.ClientID%>").val() ? $("#<%=ddlSubCategory.ClientID%>").val() : 0;
this.StockUnit = $("#<%=ddlStockUnit.ClientID%>").val() ? $("#<%=ddlStockUnit.ClientID%>").val() : 0;
this.AltrUnit = $("#<%=ddlAltrUnit.ClientID%>").val() ? $("#<%=ddlAltrUnit.ClientID%>").val() : 0;
this.Depreciation =/* $("#<=ddlDepreciation.ClientID%>").val() ? $("#<=ddlDepreciation.ClientID%>").val() : */0;
this.AltrUnitVal = $("#<%=txtAltUnit.ClientID%>").val() ? $("#<%=txtAltUnit.ClientID%>").val() : 0;
this.DepreciationVal =/* $("#<=txtDepreciationVal.ClientID%>").val() ? $("#<=txtDepreciationVal.ClientID%>").val() : */0;
this.SchemeMaping = y;
this.ScreenMaping = $("#<%=ddlScreen.ClientID%>").val();

Answers (1)