简体   繁体   中英

Hide custom element in chronoforms based on value selected in radio button

I am using Joomla 3.4.8 and ChronoForms V5.

I have made a from and I want to hide a custom element based on value of radio button. I have set two options in radio button Yes and No. I want that If i select Yes then there is custom element (below radio button that contains html table) to be shown and when i click No, the same custom element should be hidden.

I found too much but there is no option in chronoforms to deal events with custom elements.

Some google search came up that i should use "Load Javascript" element at form load and add code to it then call it through event of radio box. I added following code in "Load Javascript" element, and called the event on value Change of radio button but still does not work.

myFucntion() {
document.getElementById('fin-row-custom2').style.display = 'none';
}

Note: i found id of div using Inspect element in firefox.

Any one expert in chronoforms can help me???

Add a 'wrapping' tag - like a <div> around your custom code and give it a unique id eg id='show_table'

Then you can show/or hide the <div> using the Events tab settings in the Radio Box element.

Bob

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM