Mike Hemeles
-
Posts
9 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by Mike Hemeles
-
-
I change the
join += valeur + "<br>" join = valeur
and now it's go well, but the problem now is that when you click two or more times on the submits, the inputs are multiplied so that I want it remains the same even if you always click on, do you know how we do for that?
-
-
thanks, I have tried to do your indications like this,
var count = 1; $(function () { $('#submit').click(function () { var met = $('#nom').val(); var metiers = met.split(', '); var join = ""; $.each(metiers, function(index, valeur) { join += valeur + "<br>"; var element = document.createElement("input"); element.setAttribute("type", "text"); element.setAttribute("value", valeur); element.setAttribute("name", "txtbox"+ count); var vals = document.getElementById("inputbox"); vals.appendChild(element); var br = document.createElement("br"); vals.appendChild(br); }); }) });
<div id = "inputbox"> <input type="text" value="A, B, C, D" id="nom"> </div>
I don't know where is wrong but the input doesn't appears
-
-
ok thanks, so how can I fix it?
-
Hello,
I want to set of my input text value of a string where I split in advance, so for each array of the string set it of input!
I should it like this but the input don't loop.
$(function () { $('#submit').click(function () { var met = $('#nom').val(); var metiers = met.split(', '); var join = ""; $.each(metiers, function(index, value) { join += value; $('#input').each(function () { $(this).val(join); }); }); }) });
who can I do so that my input split and have all value of string exploded, thanks
-
Thanks for your response, It's works perfectly,
return (value !== ""); //it was for the end of the loop, but I think it was necessary in fact
Thanks,
And, is there a way to put an input for each label?
-
Hello,
$(function () { $('#selectliste').change(function () { var l = selectliste.options[selectliste.selectedIndex].innerHTML; var tous = l.split(' '); $.each(tous, function(index, value) { $("#label").html(value) + "<br>"; return ( value !== "" ); }); }) });
here, I want to get the value of my select box which are in string type, after I explode the string in array, the set the value of array in label,
But, all worked wonderfully until$("#label").html(value) + "<br>";
which only retrieves the last list of my array.
How can I make to recover all the value of my array, thank you!
loop input for each string
in JavaScript
Posted
ok thanks, I don't understand