Ask your JavaScript questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

The php-generated code works fine, but not the js-generated code. JavaScript

  • REFUNDED


This php=generated code works fine:

<div class="universal flex-container" ><div class="role flex-item">1.</div><div class="flex-item ui-widget">
<input type = "text" id = "P1" onblur="calcEntryFee(this);" maxlength = "27" name = "Player_Name" class = "autocomplete-2 text person speech-input" /></div>
<input type="checkbox" onchange="findTotalEF();" class="flex-item" tabindex="-1" id="C1" />
<div class="EF flex-item" onclick="$('#E1').removeAttr('disabled')">
<input autocomplete = "off" type = "text" onblur="findTotalEF();" name = "ef-fee" class="numbers fee fee_amt" maxlength = "1" size = "1" id = "E1" disabled /></div>
<div class="EXP flex-item" onclick="$('#CLUB_X1').removeAttr('disabled')">
<input type = "text" autocomplete = "off" onblur="getExpireDate(this);" class = "CLUBexpDate" name = "club_exp" maxlength = "10" size = "7" id = "CLUB_X1" disabled /> </div>
<div class="flex-item MEM" onclick="$('#M1').removeAttr('disabled')">
<input type = "text" autocomplete = "off" onblur="calcEntryFee(this);" name = "mem-fee" class="numbers fee fee_amt" maxlength = "2" size = "2" id = "M1" disabled /></div>
<div class="flex-item RANK" onclick="$('#Y1').removeAttr('disabled')">
<input type = "text" onblur="getClass();" class="number" name = "rating" maxlength = "4" size = "4" id = "Y1" disabled /></div>
<div class="flex-item USCF" onclick="$('#USCF_X1').removeAttr('disabled')">
<input type = "text" onblur="getUSCFexpireDate();" class="USCFexpDate" name = "uscf_exp" maxlength = "10" size = "7" id = "USCF_X1" disabled /></div>
</div>

<script> This js works BUT the web app is locked, and I can't figure out why.

east();

function east() {

let list = document.querySelector('#reg'); items = ''; for (i = 1; i < 64; i++) {

items += `<div class="universal flex-container"><div class="role flex-item">${i}.</div>`;

items += `<div class="flex-item ui-widget">`;
items += `<input type = "text" id = "P${i}" onblur="calcEntryFee(this);" maxlength = "27" name = "Player_Name" class = "autocomplete-2 text person speech-input" /></div>`;

items += `<input type="checkbox" onchange="findTotalEF();" class="flex-item" tabindex="-1" id="C${i}" />`;

items += `<div class="EF flex-item" onclick="$('#E${i}').removeAttr('disabled')">`;
items += `<input autocomplete = "off" type = "text" onblur="findTotalEF();" name = "ef-fee" class="numbers fee fee_amt" maxlength = "1" size = "1" id="E${i}" disabled /></div>`;

items += `<div class="EXP flex-item" onclick="$('#CLUB_X${i}').removeAttr('disabled')">`;
items += `<input autocomplete = "off" type = "text" onblur="getExpireDate(this);" name = "club_exp" class="CLUBexpDate" maxlength = "10" size = "7" id="CLUB_X${i}" disabled /></div>`;

items += `<div class="MEM flex-item" onclick="$('#M${i}').removeAttr('disabled')">`;
items += `<input autocomplete = "off" type = "text" onblur="calcEntryFee(this);" name = "mem-fee" class="numbers fee fee_amt" maxlength = "2" size = "2" id="M${i}" disabled /></div>`;

items += `<div class="RANK flex-item" onclick="$('#Y${i}').removeAttr('disabled')">`;
items += `<input autocomplete = "off" type = "text" onblur="getClass();" name = "rating" class="numbers" maxlength = "4" size = "4" id="Y${i}" disabled /></div>`;

items += `<div class="USCF flex-item" onclick="$('#USCF_X${i}').removeAttr('disabled')">`;
items += `<input autocomplete = "off" type = "text" onblur="getUSCFexpireDate();" name = "uscf_exp" class="numbers" maxlength = "10" size = "7" id="USCF_X${i}" disabled /></div>`;

items += `</div>`;
}

list.innerHTML = items;
}
</script>

The console log looks like this:

<div class="universal flex-container"><div class="role flex-item">1.</div><div class="flex-item ui-widget">
<input type = "text" id = "P1" onblur="calcEntryFee(this);" maxlength = "27" name = "Player_Name" class = "autocomplete-2 text person speech-input" /></div>
<input type="checkbox" onchange="findTotalEF();" class="flex-item" tabindex="-1" id="C1" />
<div class="EF flex-item" onclick="$('#E1').removeAttr('disabled')">
<input autocomplete = "off" type = "text" onblur="findTotalEF();" name = "ef-fee" class="numbers fee fee_amt" maxlength = "1" size = "1" id="E1" disabled />
</div>
<div class="EXP flex-item" onclick="$('#CLUB_X1').removeAttr('disabled')">
<input autocomplete = "off" type = "text" onblur="getExpireDate(this);" name = "club_exp" class="CLUBexpDate" maxlength = "10" size = "7" id="CLUB_X1" disabled />
</div>
<div class="MEM flex-item" onclick="$('#M1').removeAttr('disabled')">
<input autocomplete = "off" type = "text" onblur="calcEntryFee(this);" name = "mem-fee" class="numbers fee fee_amt" maxlength = "2" size = "2" id="M1" disabled />
</div>
<div class="RANK flex-item" onclick="$('#Y1').removeAttr('disabled')">
<input autocomplete = "off" type = "text" onblur="getClass();" name = "rating" class="numbers" maxlength = "4" size = "4" id="Y1" disabled />
</div>
<div class="USCF flex-item" onclick="$('#USCF_X1').removeAttr('disabled')">
<input autocomplete = "off" type = "text" onblur="getUSCFexpireDate();" name = "uscf_exp" class="numbers" maxlength = "10" size = "7" id="USCF_X1" disabled />
</div>
</div>


Answers (1)

2019-09-15

Arnav Joy answers:

What you are trying to achieve?


User180435 comments:

trying to convert php to js