javascript - Get value for associated cell onchange -


i have .hta set of drop down boxes created dynamically inside of table. table generates json file. table looks (there more table gives idea):

output += "<td style='display:none' name='expensive' style='background-color:#ededed'><center><input id='expensive_box' type='checkbox'></center></td>" +  "<td style='display:none' name='cheap'><center><input id='cheap_box' type='checkbox'></center></td>" +  "<td style='display:none' id='spdropsyst' name='spdropsyst'><select class='jumpmenu' name='sprating' id='sprating' onchange='writerate()'><option id='blank' selected='selected'>...</option><option id='accepted' value=''>sp accepted</option><option id='declined' value=''>sp declined</option></select></td>"; output +=  "<td id='biz_name'>" + results[i]["business name"] + "</td>" + "<td style='display:none' name='addresscol'>" + results[i]["address"] + "</td>" +  "<td><center>" + results[i]["city"] + "</center></td>" +  "<td><center>" + results[i]["statelisting"] + "</center></td>";  

each row written

document.getelementbyid("placeholder").innerhtml = output;

each row generated own dropdown. onchange function is:

function writerate() {  var fso = new activexobject("scripting.filesystemobject"); var write_id = "file write here"; alert('the information has been forwarded oon map team, thank you!'); var s = fso.opentextfile(write_id, 8, true); alert(write_id);  s.writeline(" "); if (document.getelementbyid('cheap_box').checked){ s.writeline('cheap'); }  if (document.getelementbyid('expensive_box').checked){ s.writeline('expensive'); } s.close(); } 

now looking when box on line x changed, want grab business name of same row x written out file. if changes drop x, write out business x, , if changes drop y, write out business y.

i passing business names array generate table. have:

sparray.push(results[i]["business name"]; 

and able call of names, cannot associate name box. how done in simplest way?

figured out instead taking array sparray , using populate drop down list instead. instead of having dynamically created set of drop downs have 1 drop down, can grab selected value drop down easily. problem solved happiness.


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -