Page 1 of 1

read text value of select

Posted: 2018-12-09 21:25
by hubert
Hi,

Have a few select and looking to read the text value (not the ID) selected in order to construct identificator.
I'm not very clear with JS but I tried..
Can read ID with "document.getElementById" but all code after like "select.options[ index ].value" give issue.

Any idea ?

Re: read text value of select

Posted: 2018-12-12 12:51
by a.gneady
If this is a lookup field in one of your AppGini detail view forms, try:

Code: Select all

$j('#s2id_fieldname-container').text().trim()
(Replace fieldname with the actual field name)

Re: read text value of select

Posted: 2018-12-14 08:37
by hubert
Excellent Ahmad, it's a lookup field and works fine !
Many thx !