Home › Forums › ACF PRO › Extending the URL field. › Reply To: Extending the URL field.
I’ve figured out that I need to use the following code…
However, while the code runs on new fields added via repeaters, it does not run on fields during the initial load.
I’ve opened a new thread more in line with the issue I am facing…
acf.addAction('new_field/type=url', function(field){
field.$el.find('input[type=url]').on('blur', function(e){
var val = $(this).val();
if((!(val.indexOf('://') !== -1)) && (val.length !== 0)){
$(this).val('http://' + val);
}
});
});
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.