Hi!
As you can see on http://jsbin.com/erivi/ I'm using Jquery to change some image (and image attribute) depending on radio button selected, I'm also removing form text when clicking inside it.
And now what I'm trying to do is to change the text of the form depending on the radio button checked.
For example when clicking on "Choice 3" we should see "Text of input 3".
You can see & edit my code live here: http://jsbin.com/erivi/edit
The part I need to improve is:
imgFldr = 'http://download.kde.org/khotnewstuff/icons/previews/';
$("input[type='radio']").click(function() {
var strarr = this.title.split('|');
if(strarr.length < 2) return;
$('#'+this.name).attr('src', imgFldr+strarr[0]).attr('alt', strarr[1]).attr('title', starr[2]);
});
And particularly .attr('title', starr[2]);
which is supposed to change title depending on the 3rd part of my radio title (exemple: title='m602-1.png|Logo 3|Text of input 3'
)
Thanks :)
Edit: I forgot to mention that I'm using several forms on my real code, that's why I'm looking for a way to do this without the particular name of the text input in order to avoid repeating script for other text input.