Create input select image URL?

By Javascript you can pop-up the media and on select you can update the image URL to the textbox. Below is the code. var custom_uploader; jQuery(‘<Should-be-a-button-selector>’).click(function(e) { e.preventDefault(); //If the uploader object has already been created, reopen the dialog if (custom_uploader) { custom_uploader.open(); return; } //Extend the wp.media object custom_uploader = wp.media.frames.file_frame = wp.media({ title: … Read more

Plugin option for input box validation

You want to set the input’s type to number for numeric validation. And use the input’s value to set a default value. <input type=”number” id=”title” name=”my_option_namePlugin option for input box validation” value=123 /> If you just want a hint displayed to the user inside the input, use placeholder. <input type=”number” id=”title” name=”my_option_namePlugin option for input … Read more

How to change number field to text field using JS

The original code is using prevAll on the minus button, but the target input appears later in the DOM. PrevAll worked fine for the plus button though, since the targeted input comes before the plus button. The modified code below is tested and working: jQuery(document).ready(function ($) { // Containing selector var parentSelector = $(‘.quantity’); // … Read more