12
Views
2
Comments
Solved
get Form Field Name

how I could get the Form fields name and to save it in the Database or local variable.

Solution

Hi, 

If you are looking for traditional please use below logic.

var formIS = document.getElementById("""+RecordForm.Id+""");
var labels = formIS.getElementsByTagName('label');
var total = labels.length;
var output='';
for(var i =0;i<total;i++){
    output +=labels[i].innerHTML+''+(i!==total-1?',':'');
}
document.getElementById("""+labels.Id+""").value=output;
console.log(output);

Have a hidden field (in above code case "labels") and set the value later you can use it.

Bind the value to the local variable 



Regards,

Rama



Hi Balqis,

You can use below code in Ready call back of screen or web block. Below script will return you comma separated field name. 



Regards,

Rama

Solution

Hi, 

If you are looking for traditional please use below logic.

var formIS = document.getElementById("""+RecordForm.Id+""");
var labels = formIS.getElementsByTagName('label');
var total = labels.length;
var output='';
for(var i =0;i<total;i++){
    output +=labels[i].innerHTML+''+(i!==total-1?',':'');
}
document.getElementById("""+labels.Id+""").value=output;
console.log(output);

Have a hidden field (in above code case "labels") and set the value later you can use it.

Bind the value to the local variable 



Regards,

Rama