Hi,
Thank you for your enquiry.
It is possible to use one text box to display the results, which can cater for any number of returned records. For example, try the following:
- Open the
scriptDB_Example3 sample publication
- Delete the five 'Text' and 'Surname' objects which are currently set to display the returned results
- Add a text object to the page
- Name the text object
Textbox and give it a vertical scrollbar
- Now open the
Script 1 object on the page
- Modify the
ShowRecords() function to read the following:
Code:
function ShowRecords()
{
text = ""
if (records == null) {
return; // need to call Search First to get records
}
var num_records = records.GetNumberOfRecords();
for (num=1; num <= num_records; num++)
{
Textbox.SetSelection(0, -1); // Select all text in box
if (num <= (num_records - Start_Record_Num + 1)) {
text = text + (records.First_Name + " " + records.Surname + "\n")
Textbox.ReplaceSelection(text);
} else {
Textbox.ReplaceSelection(""); // Clear the text box
}
records.NextRecord();
}
}
This will display the results of the search within the Textbox object, with the
First_Name record and
Surname record separated by a space and with each record separated by a line return.
I hope this helps. Please do not hesitate to contact me if you have any further queries.
Kind regards,