changing placeholder in opera mini
Asked Answered
M

3

8

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?

Mcdonough answered 14/3, 2014 at 10:12 Comment(1)
can you add the fiddle to reproduce the issue.?Pillory
O
1

Check if your version of opera is here:

CLICK ME :)

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

Onassis answered 18/3, 2014 at 6:5 Comment(2)
That's why I am using the plugin above to make it workMcdonough
OK :) sorry :) Didn't get that :)Onassis
R
1

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.

Rexanna answered 18/3, 2014 at 6:14 Comment(4)
The issue is that this is a plugin, while I require a library.. like the one I have linked above in my original postMcdonough
what you added in your link is a plugin. A library is involving a collection of many utilities and functions useful to your javascript code to help with your design efforts rather than the implementation of something. Shivs (plugins) are mainly the route you want to take when you have a lack of support for something that is backwards compatible. In your case, it's a special instance, so a plugin is involved.Rexanna
I'm not sure if I understand your question,the links i gave you are javascript plugins.. the code you mentioned in your question is a javascript plugin.Rexanna
I just tried it and apparently the plugin above doesn't work in opera miniMcdonough
P
0

Opera-mini doesn't support placeholder attribute for HTML input. You can check whether Opera-Mini supports something or not in the website Mr.TK pointed out: http://caniuse.com/input-placeholder.

Produce answered 11/7, 2014 at 10:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.