You need to sign in to do that
Don't have an account?
Gaurav Puranik
Input tag value of HTML is not setting by variable while appending new row by jquery
Hi all,
I want to set input tag value of html of the new append row by jquery...here is my code which I have written
$(document).ready(function(){
var evtName = '';
var OppoId = '{!Opportunity.Id}';
var query1 = 'SELECT Id,Name,Opportunity__c,Visit_Date__c,Result__c,LastModifiedDate FROM Event__c WHERE Opportunity__c = \'' + OppoId + '\'';
var records = sforce.connection.query(query1);
var records1 = records.getArray('records');
console.log(records1);
if(records1.length >0){
for(var i=0;i<records1.length;i++){
var evtName = records1[i].Name;
var evtResult = records1[i].Result__c;
var evtVisitDate = records1[i].Visit_Date__c;
var evtLastDate = records1[i].LastModifiedDate;
$("#customFields").append('<tr id="trId1" class="tr1Cls"> <td width="1%"> <a style="text-decoration: underline; cursor: pointer;" >Edit</a> </td> <td width="1%"> <a style="text-decoration: underline; cursor: pointer;" onclick="CreateNewEvent(this);">Save</a> </td> <td width="1%"> <a style="text-decoration: underline; cursor: pointer;">Del</a> </td> <td width="10%" style="text-align: center;"> <input class="datepicker1" value=evtVisitDate></td> <td width="10%" style="text-align: center;"> <input type="text" class="inputCls" value="evtName" required="true"/> </td> <td width="10%" style="text-align: center;"> <input type="Text" value=evtResult /> </td><td width="20%" style="text-align: center;"><input type="text" value =evtLastDate/></td> </tr> ');
}
here new row is appending but Im not getting the value evtVisitDate, evtName, evtResult , evtLastDate...the new row is appending with value as
'evtVisitDate' in the first column
'evtName' in the second column
'evtResult' in the third column
'evtLastDate' in the fourth column
var evtName = records1[i].Name;
var evtResult = records1[i].Result__c;
var evtVisitDate = records1[i].Visit_Date__c;
var evtLastDate = records1[i].LastModifiedDate;
whereas, I already defined value of all this variable...
Anyone has any idea on this..
Thanks in advance
I want to set input tag value of html of the new append row by jquery...here is my code which I have written
$(document).ready(function(){
var evtName = '';
var OppoId = '{!Opportunity.Id}';
var query1 = 'SELECT Id,Name,Opportunity__c,Visit_Date__c,Result__c,LastModifiedDate FROM Event__c WHERE Opportunity__c = \'' + OppoId + '\'';
var records = sforce.connection.query(query1);
var records1 = records.getArray('records');
console.log(records1);
if(records1.length >0){
for(var i=0;i<records1.length;i++){
var evtName = records1[i].Name;
var evtResult = records1[i].Result__c;
var evtVisitDate = records1[i].Visit_Date__c;
var evtLastDate = records1[i].LastModifiedDate;
$("#customFields").append('<tr id="trId1" class="tr1Cls"> <td width="1%"> <a style="text-decoration: underline; cursor: pointer;" >Edit</a> </td> <td width="1%"> <a style="text-decoration: underline; cursor: pointer;" onclick="CreateNewEvent(this);">Save</a> </td> <td width="1%"> <a style="text-decoration: underline; cursor: pointer;">Del</a> </td> <td width="10%" style="text-align: center;"> <input class="datepicker1" value=evtVisitDate></td> <td width="10%" style="text-align: center;"> <input type="text" class="inputCls" value="evtName" required="true"/> </td> <td width="10%" style="text-align: center;"> <input type="Text" value=evtResult /> </td><td width="20%" style="text-align: center;"><input type="text" value =evtLastDate/></td> </tr> ');
}
here new row is appending but Im not getting the value evtVisitDate, evtName, evtResult , evtLastDate...the new row is appending with value as
'evtVisitDate' in the first column
'evtName' in the second column
'evtResult' in the third column
'evtLastDate' in the fourth column
var evtName = records1[i].Name;
var evtResult = records1[i].Result__c;
var evtVisitDate = records1[i].Visit_Date__c;
var evtLastDate = records1[i].LastModifiedDate;
whereas, I already defined value of all this variable...
Anyone has any idea on this..
Thanks in advance