node.js-How to ensure that the desired filed values goes to ajax?

I am trying to pass some values to the AJAX field as follows

res.write(<input type="hidden" class="story" name="'+i+'" value="'+namet[i]+'"/>);
res.write('<div class="editInPlace">'+comment[i]+'</div>');

Problem here is irrespective on any <div> i click only the first hidden field value is passed.So how should I ensure that the corresponding value of hidden field of the <div> tag is passed here?Thankx in advance.

it seems dynamically added field values will not be considered while form submission. why cant you add a separate form with desired field values?