Page 1 of 1

Retriving values to Onclick

Posted: Thu Nov 30, 2017 4:50 pm
by edalakiran
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.

Re: Retriving values to Onclick

Posted: Thu Nov 30, 2017 5:41 pm
by Emily
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:

Code: Select all

var test = get("Element-ID");
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

Re: Retriving values to Onclick

Posted: Fri Dec 01, 2017 2:03 pm
by edalakiran
Thank you, That works fine.