tags:

views:

30

answers:

1

Hi,

I have a tabular report that allows the user to enter a reference no. (text item) as well as a comment textarea item.

The report can vary in amount of records displayed but for this example, lets say I have 10 records in the report.

What I am after but unsure how to do, is to create two new fields identifying both comment and reference no field - let the user type info in these two fields and then have a "Populate All" button that will go through each record in the report and assign the reference no. value and comment value to each of the 10 records.

Would appreciate some help.

Thanks. Tony.

+1  A: 

It's not completely clear to me what you're trying to do here. Do you have a regular HTML form laid out in a table, and then the last two table cells on each row have an input/text area element in them? If so, I would think the easiest way to go about it would be to assign a common class to the input elements in each column, such as 'refno' and 'comment' then have some code like this in the 'PopulateAll' button onclick event:

$(".refno").each(function() {this.value = $($("#refglobal").value)});

This assumes your field for adding the reference number to all has an id of refglobal and that you're using jQuery (though other libraries will allow similar syntax, and coding it out longhand wouldn't be too much effort in this case).

If this is not what you're trying to do, please clarify your question.

robertc