Hi,
i have a output field like [xyz123]. it will retrieve some data from database, it was hidden, i want to pass that information to the onclick Event, before when it was not hidden i tried " var test = document.getElementById('xyx123').innerHTML;" i got the data but when it was hidden i was unable to retrieve the data, is there any way to assign directly variable in onclick event.
Anyhelp would be appreciated.
Thanks
Kiran.
Retriving values to Onclick
-
- New User
- Posts: 16
- Joined: Fri Nov 03, 2017 5:09 pm
- First Name: Teja
- Last Name: Edala
- Company Name: win
- City: Cincinnati
- State / Province: Ohio
- Zip / Postal Code: 45249
- Country: United States
- Contact:
- Emily
- Profound Logic Staff Member
- Posts: 89
- Joined: Tue Jun 21, 2016 8:30 am
- First Name: Emily
- Last Name: Seage
- Company Name: Profound Logic
- Contact:
Re: Retriving values to Onclick
Hi Kiran,
If you want to get the value of a hidden output field, you should be able to use the get() API for this. So, you could do something like this in your onclick event:
Then, the 'test' variable should contain the value of the hidden output field. It's important to note that you will need to change the ID to reflect the appropriate ID of your output field, but this should help with what you're wanting to accomplish. If you need more information on this API, we have a documentation page here: http://www.profoundlogic.com/docs/pages ... Id=3276803.
I hope that this helps!
--Emily
If you want to get the value of a hidden output field, you should be able to use the get() API for this. So, you could do something like this in your onclick event:
Code: Select all
var test = get("Element-ID");
I hope that this helps!
--Emily
Emily Seage
Support Team Lead
Support Team Lead
-
- New User
- Posts: 16
- Joined: Fri Nov 03, 2017 5:09 pm
- First Name: Teja
- Last Name: Edala
- Company Name: win
- City: Cincinnati
- State / Province: Ohio
- Zip / Postal Code: 45249
- Country: United States
- Contact:
Re: Retriving values to Onclick
Thank you, That works fine.
Who is online
Users browsing this forum: No registered users and 2 guests