read text value of select

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
hubert
Veteran Member
Posts: 50
Joined: 2018-12-06 22:32

read text value of select

Post by hubert » 2018-12-09 21:25

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 ?

User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: read text value of select

Post by a.gneady » 2018-12-12 12:51

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)
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

hubert
Veteran Member
Posts: 50
Joined: 2018-12-06 22:32

Re: read text value of select

Post by hubert » 2018-12-14 08:37

Excellent Ahmad, it's a lookup field and works fine !
Many thx !

Post Reply