Forums

fill in text box with radio checked

amaze 10 Oct, 2011
Hi I wanted to create a form with a radio field say others and when this radio is checked the user must fill in a text field to indicate what is the others how do i implement a check for this? Thanks!
Max_admin 20 Oct, 2011
Hi amaze,

Here is how:

#1- assign a field id to the "others" radio, say "id="others"
#2- assign a field id to the "others" text box, say id="others-text"
#3- add a "load js" action and add this code inside:

$('others').addEvent('change', function(){
$("others-text").addClass("validate['required']");
formCheck.register($('others-text'));
});


This should do it I hope.

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.