my main tergate is that i have 2 radio button and 2 text field.
when i click on a radio button1, then the corrosponding text field say
text1 will b active, and another text field say text2 will b inactive.
and again when if we click on the other radio button2 then the
corrosponding text field say text2 will be active and text1 will b
inactive…
NOTE : Basically i am very new in Ruby On Rails…so i cant do this.
if anyone kindly hepl me i will be very much thankful to him/her
my main tergate is that i have 2 radio button and 2 text field.
when i click on a radio button1, then the corrosponding text field say
text1 will b active, and another text field say text2 will b inactive.
and again when if we click on the other radio button2 then the
corrosponding text field say text2 will be active and text1 will b
inactive…
NOTE : Basically i am very new in Ruby On Rails…so i cant do this.
if anyone kindly hepl me i will be very much thankful to him/her
have a look at jQuery, which is perfect for this sort of thing. You’ll
need to know a little bit of javascript (syntax mainly) but that’s
pretty much essential for web dev.
You could set up the html as follows (this is inside a form):
my main tergate is that i have 2 radio button and 2 text field.
when i click on a radio button1, then the corrosponding text field say
text1 will b active, and another text field say text2 will b inactive.
and again when if we click on the other radio button2 then the
corrosponding text field say text2 will be active and text1 will b
inactive…
NOTE : Basically i am very new in Ruby On Rails…so i cant do this.
if anyone kindly hepl me i will be very much thankful to him/her
have a look at jQuery, which is perfect for this sort of thing. You’ll
need to know a little bit of javascript (syntax mainly) but that’s
pretty much essential for web dev.
You could set up the html as follows (this is inside a form):
then, at the top of the page, you could have the following script
(obviously it will only work once you’ve installed jQuery)
this is all untested!
jQuery is fantastic and has loads of really useful plugins - it’s really
essential.
good luck.
Oops., i forgot one important thing! The jQuery commands need to go
inside a ‘document ready’ block, which is run as soon as the page has
loaded. So, the script element should be:
still i am faceing some problem…the text field2 is not working with
the corrosponding radio button.
Even when i select the radio button2 then also text field2 also
disable & textfield 2 also enable…
still i am faceing some problem…the text field2 is not working with
the corrosponding radio button.
Even when i select the radio button2 then also text field2 also
disable & textfield 2 also enable…
Would you mind opening the page source and copying the section with the
fields and radio buttons, and posting it up here?
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.