I have a website url field that has the value set for returning visitors who have previously filled out the form. If they change the value, then ('keyup blur paste', function()
will copy it to a div
. If they do not change the value, the ('keyup blur paste', function()
does not copy the value to the div
I would like to figure out how to add to this script a function that would also copy the value to the div
if they do not change it, because blur
only works if they click in the input before they submit the form.
Here is my current script:
$(function () {
$('#Website').on('keyup blur paste', function() {
var self = this;
setTimeout(function() {
var str = $(self).val();
$("#viewer").text(str.replace(/^http\:\/\//, ''));
}, 0)
})
});