TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
John
NA
928
131k
Set value to textbox array using jquery
Oct 25 2017 1:21 PM
Have the below textbox array
<div id="addFruits" style="display:none;">
<div class="input-group col-sm-9 addMore">
<input type="text" class="form-control" name="Fruit[]" placeholder="Fruit" disabled>
<span class="input-group-addon btn-add" onclick="removeThis(this);"><a href="javascript:;">--</a></span>
</div>
</div>
<div class="controls" id="addFruit">
<div class="input-group col-sm-9 addMore">
<input type="text" class="form-control" id="Fruit" name="Fruit[]" placeholder="Fruit">
<span class="input-group-addon btn-add" onclick="addMore('addFruit','addFruits');"><a href="javascript:;">+</a></span>
</div>
</div>
Jquery function
function addMore(id,colonId)
{
var y =$('#'+id).children().size();
var max_fields=5;
if(y < max_fields){
y++;
$('#'+colonId).children().clone().appendTo('#'+id);
$('#'+id).find('input:disabled').prop("disabled", false);
}
else
{
alert('Limit to add more exceeded!');
}
}
Now i have stored the 4 values as comma separated in database
Apple,Mango,Orange,Cherry
How do i display and fill the 4 textboxes with individual value in it
Reply
Answers (
2
)
how to keep validation off in jquery
jQuery AJAX always executing error: {}