show hidden div based on user input

Vikash Rai
Vikash Rai used Ask the Experts™
i am new to codeigniter, just have 15 days of experience. i have to ask how to implement a div block of input type text for kids name, grade and course base on number of kids entered by parents??
i have a input type " number of kids" and based on that i want to display a div of level and input type according to number of kids entered like if parents entered 3 kids then i want a div with 3 labels and input type of name and grades...please help me
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2014
test page :

<!DOCTYPE html>
    <script src=""></script>
        jQuery(function($) {
            $("#nbKids").blur(function() {
                var nbKids = $(this).val();
                if(isNaN(nbKids)) {
                    alert("please enter valid number");
                var divs = [];
                for(var i=0;i<nbKids;i++) {
                    divs.push("<div><input name='childname[]'><input name='childgrade[]'><input name='childcourse[]'></div>");
nb kids :<input type="text" id="nbKids">
<div id="divs"></div>

Open in new window


Thanks alot

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial