Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

changing placeholder in opera mini

I am currently using this code to replace the placeholder functionality where it is not available. I have a click listener on jQuery which changes the placeholder text:

$('.contact-type').change(function(event) {
    $contactInfo = $(this).closest('div').prev().find('#contact-info');
    $contactInfo.removeClass();
    $contactInfo.addClass('form-control input-lg');

    $contactInfo.addClass('validate[required,custom[line]]');
    $contactInfo.attr("placeholder", "LINE ID");
})

The issue is that when using the jquery placeholder, when I changed the placeholder text and then I called $('input, textarea').placeholder();. The new placeholder doesn't change. How can I also change the placeholder when the value changed?

like image 988
adit Avatar asked Mar 14 '14 10:03

adit


2 Answers

Check if your version of opera is here:

CLICK ME :)

It may just not work, because developers didn't code it. ;)

like image 187
Mr.TK Avatar answered Oct 21 '22 08:10

Mr.TK


there's a whole slew of placeholders that you could check and see if it could work for opera:

https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyfills#web-forms--input-placeholder

Modernizr is a very nice tool that is useful for checking backwards compatibility of html5 on older browsers.

Did more digging and apparently this site gives opera mini consideration in adding placeholders (though I haven't tested it myself since I don't have opera mini installed on my computer):

http://www.mightyminnow.com/2013/09/mightyminnow-plugin-html5-jquery-polyfill/

Give that a go too. I know it can be frustrating, I had to do tons of tweaks on a recent project just to support ie7 stuff.

like image 45
sksallaj Avatar answered Oct 21 '22 07:10

sksallaj