Thank you for your reply. The copied form is exactly the same as the original. I think the options are filled up dynamically using javascript. Below is the code.
//Count rows in Correction Table
$(document).ready(function() {
rowcount2();
$('.myTable2').on('click', '.form-del-field', function () {
rowcount2();
});
$('.myTable2').on('click', function () {
rowcount2();
});
$('.myTable2').on('click', '.cf-table-add-row', function () {
rowcount2();
});
function rowcount2() {
$('.myrows2 input').val($('.myTable2 tr').length-1);
}
});
//Add New Row to Approval Table for additional approvals
$( document ).ready(function() {
// alert('works');
var status = $('#q2 input').val();
//var table2 = $('.myrows2 input').val()*1;
//alert(status);
if (status=='Pending Approval'){
$('.mytable .cf-table-add-row').trigger('click')
}
});
//Add correction row to match approval row
$( document ).ready(function() {
var table1 = $('.myrows input').val()*1;
var table2 = $('.myrows2 input').val()*1;
var status2 = $('#q2 input').val();
// alert(table1);
if ((table1!=table2) && (status2=='Pending Corrections')){
$('.myTable2 .cf-table-add-row').trigger('click')
}
});
//Show Applicable Action Button
$(document).ready( function() {
$(".action-btn.Submit").hide();//Return for corrections
// alert($('.step').text());
var formsstep = $('.formsstep input').val()
if ((formsstep == "Initial Submission")||(formsstep == "Pending Corrections")){
$(".action-btn.Approve").hide();
$(".action-btn.Submit").show();
$(".action-btn.Reject").hide();
}else{
$(".action-btn.Approve").hide();
$(".action-btn.Submit").hide();
$(".action-btn.Reject").hide();
}
$('.decision select').change( function() {
if ($(this).val() == "Approved"){
$(".action-btn.Approve").show();
$(".action-btn.Submit").hide();
$(".action-btn.Reject").hide();
}
else if ($(this).val() == "Rejected"){
$(".action-btn.Approve").hide();
$(".action-btn.Submit").hide();
$(".action-btn.Reject").show();
}
else if ($(this).val() == "Return for Corrections"){
$(".action-btn.Approve").hide();
$(".action-btn.Submit").show();
$(".action-btn.Reject").hide();
}else{
$(".action-btn.Approve").hide();
$(".action-btn.Submit").hide();
$(".action-btn.Reject").hide();
}
});
});
$( document ).ready(function() {
$('.theNumber input').change(function(){
var numberCols = $('.theNumber input').val();
for (var i = 0; i < numberCols; i++){
$('#q50 .cf-collection-append').trigger('click');
}
});
});