i was working with my thesis, i got stumble when i tried to store a tag to some uploaded file
ive found some javascript to help me create tags on upload page.
$("#tags input").on({
focusout : function() {
var txt = this.value.replace(/[^a-z0-9\+\-\.\#]/ig,''); // allowed characters
if(txt) {
$("<span/>", {text:txt.toLowerCase(),value:txt.toLowerCase(), insertBefore:this});
$("<input/>", {type:"hidden",value:txt.toLowerCase(),name:"Tags", insertBefore:this});
}
this.value = "";
},
keyup : function(ev) {
// if: comma|enter (delimit more keyCodes with | pipe)
if(/(188|13)/.test(ev.which)) $(this).focusout();
}
});
$('#tags').on('click', 'span', function() {
if(confirm("Remove "+ $(this).text() +"?")) $(this).remove();
});
});
what if i want to pass multiple tag to my upload controller with this js?
ive tried using input type hidden, but it only pass 1 value at a time, and also, i cant delete the input value, so if im mistaken and delete the tag, the hidden input doesnt get deleted too.
pls help me, Thankyou in advance!
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2AIIdFf
via IFTTT
Aucun commentaire:
Enregistrer un commentaire