inconsistent javascript duty results


i have duty javascript formula updates html fields new values whenever called. problem can't duty itself since works brilliantly each domain solely one. here js function:



  duty updatefields() {
document.getelementbyid('bf').innerhtml = bill.time[breakfast][bill.pointpartofweek];
document.getelementbyid('ln').innerhtml = bill.time[lunch][bill.pointpartofweek];
document.getelementbyid('dn').innerhtml = bill.time[dinner][bill.pointpartofweek];
document.getelementbyid('se').innerhtml = bill.time[special][bill.pointpartofweek];
document.getelementbyid('fdr').innerhtml = bill.time[full][bill.pointpartofweek];
document.getelementbyid('cost').innerhtml = bill.cost;
}


and executes glorious following instance:



  <select onchange='if(this.selectedindex == 0) {bill.unholiday();updatefields()} else { bill.holiday();updatefields()}' id='date' name='date'>
<option value='else'>jan. 02 - nov. 20</option>
<option value='christmas'>nov. 20 - jan. 01</option>
</select>


but unequivocally identical code, final line duty doesn't seem govern (it doesn't transform cost field, nonetheless updates all else)



  <select onchange='if(this.selectedindex == 0) {bill.pointpartofweek = 1;} else { bill.pointpartofweek = 2;}updatefields();alert(updatefields());' id='day' name='day'>
<option value='0'>monday thru thursday</option>
<option value='1'>friday, saturday, sunday</option>
</select>
<br />


strangely enough, sum cost non-static itself updated, nonetheless domain represents non-static not. another domain page wouldn't change value sum cost nonetheless calls updatefields duty again, cost domain following updates correctly. contingency an emanate duty called.



note: know duty executes since does 5 out 6 things ostensible do. uncanny issue.



edit: pastebin whole page helpful. here is:





Comments

Popular posts from this blog

list macos calm editors formula editors

how i practical urls indicate .aspx pages asp.net deployed an iis? (preferably but iis)

jaxb - xjc - reworking generated typesafe enum category members