onselect javascript help

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
amc
Profound User
Posts: 67
Joined: Thu Jul 29, 2010 1:25 am
First Name: Tony
Last Name: Cusack
Company Name: Welding Industries
City: Adelaide
State / Province: Outside Canada/USA
Zip / Postal Code: 5139
Country: Australia
Location: Adelaide, South Australia
Contact:

onselect javascript help

Post by amc »

In database-driven auto-complete textboxes, i usually just use pui.click & process the selected item in rpg.

In the code I am presently working on , I would like to process the selection in JavaScript.

The help in the designer says that the selected item will be passed as a JSON object to my function. I suppose that it will look like this ?

Code: Select all

{"fieldName1":"value1","fieldName2":"value2"}
So, if I have a function like this

Code: Select all

function processSelected(o){
alert(o.fieldName1)
}
what is the name of the JSON object that I should be putting in the onselect attribute of the textbox ?

Code: Select all

processSelected(?)
or am I way off the track here ?

Any help appreciated.

Thanks & regards

Tony C
User avatar
Rob
Profound Logic Staff Member
Posts: 135
Joined: Fri Jan 04, 2008 12:12 pm
First Name: Rob
Last Name: Ferguson
Company Name: Profound Logic Software
Contact:

Re: onselect javascript help

Post by Rob »

in the onselect property, add the name of your function without any parenthesis or parameters.

for example processSelected


when you define the function you would do it as you suspected

Code: Select all

function processSelected(o){
alert(o.CATID);

}
in my case, I used PUISAMPLES/CATEGP as the database file. CATID is the field name passed in the JSON object.
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests