Jump to content

retrieve value from repeat region using onclick


xjx424

Recommended Posts

try this:

bod = new Array();function init () {var links = document.getElementById("mail_list").getElementsByTagName("a");var bodies = document.getElementById("mail_list").getElementsByTagName("input");for (i2 = 0; bodies[i2]; i2++) {bod[i2] = bodies[i2].value;}for (i = 0; links[i]; i++) {links[i].onclick = function hiya () {document.getElementById("body_text").value = bod[this.id.match(/[0-9]+$/)];}links[i].id += 2*i // HERE IS WHERE I CHANGED IT}}window.onload = init;

Seems a little iffy to me. It might throw off your check boxes, but if it works it works. If you have more problems just come on back lol.If you want to know how i figured that out so you can learn, I just saw that all of your input boxes were causing the emails to open on every other email so i just accounted for the double inputs by making the variable double when assigning the id's.

Link to comment
Share on other sites

  • Replies 52
  • Created
  • Last Reply

Again, you are welcome. And if I end up helping you in the future, for sake of saving time, I'm not going to say you're welcome anymore ok? lolPS: Your page is looking good. Keep it up.EDIT: I suppose you could have made the increment for the for loop go up by 2 each time? I didn't try that but I guess there are several ways to do one thing.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...