trying to add new row to a form, not working

i have a form im trying to add a new row to and its not working nay ideas of why please

thank you in advance for any code or help you may provide
<?php

    // version:



?>

<html>
<head>
    
   <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js">
        $(document).ready(function(){ 
            $row = 0;
            $(".addRow").click(function(){
                $row = $row + 1;
              $('#row').append('<tr><td> \
                <input type="text" name="quantity[' + $row + '][1]" value="" maxlength="2" size="2"  /></td> \
                <td><select name="bulb_type_id[' + $row + '][2]"> \
                    <option value="1">Option 1</option> \
                    <option value="2">Option 2</option> \
                    <option value="3">Option 3</option> \
                </select></td> \
                <td><input type="checkbox" name="required[' + $row + '][3]" value="1"  /></td> \
                </tr>');
          });
        });
    </script> 
    
</head>
<body>

<table cellspacing="0">
<thead>
    <tr>
        <th>Qty</th>
        <th>Option</th>
        <th>Required ?</th>
    </tr>
</thead>
<tbody id="row">
    <tr>
        <td>    
            <input type="text" name="quantity[0][1]" value="" maxlength="2" size="2"  />
        </td>
        <td>    
            <select name="bulb_type_id[0][2]">
	                        <option value="1">Option 1</option>
	                        <option value="2">Option 2</option>
	                        <option value="3">Option 3</option>
                </select>
            <? 
            //echo form_dropdown('bulb_type_id[0][2]', $bulb_types);
            ?>
        </td>
        <td>    
            <input type="checkbox" name="required[0][3]" value="1"  />
        </td>
    </tr>
</tbody>
</table>

<p><a href="#" class="addRow">Add another row</a></p>

Open in new window

JohnnyAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

leakim971PluritechnicianCommented:
replace line 12 by theses two lines :
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
   <script type="text/javascript">

Open in new window

JohnnyAuthor Commented:
still no joy with changes

<?php

    // version:



?>

<html>
<head>
    
   <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
   <script type="text/javascript">
        $(document).ready(function(){ 
            $row = 0;
            $(".addRow").click(function(){
                $row = $row + 1;
              $('#row').append('<tr><td> 
                <input type="text" name="quantity[' + $row + '][1]" value="" maxlength="2" size="2"  /></td> 
                <td><select name="bulb_type_id[' + $row + '][2]"> 
                    <option value="1">Option 1</option> 
                    <option value="2">Option 2</option> 
                    <option value="3">Option 3</option> 
                </select></td> 
                <td><input type="checkbox" name="required[' + $row + '][3]" value="1"  /></td> 
                </tr>');
          });
        });
    </script> 
    
</head>
<body>

<table cellspacing="0">
<thead>
    <tr>
        <th>Qty</th>
        <th>Option</th>
        <th>Required ?</th>
    </tr>
</thead>
<tbody id="row">
    <tr>
        <td>    
            <input type="text" name="quantity[0][1]" value="" maxlength="2" size="2"  />
        </td>
        <td>    
            <select name="bulb_type_id[0][2]">
	                        <option value="1">Option 1</option>
	                        <option value="2">Option 2</option>
	                        <option value="3">Option 3</option>
                </select>
            <? 
            //echo form_dropdown('bulb_type_id[0][2]', $bulb_types);
            ?>
        </td>
        <td>    
            <input type="checkbox" name="required[0][3]" value="1"  />
        </td>
    </tr>
</tbody>
</table>

<p><a href="#" class="addRow">Add another row</a></p>

Open in new window

Greg AlexanderLead DeveloperCommented:
Looks like you needed to close the jquery script tag and reopen them for the function
<?php

    // version:



?>

<html>
<head>
    
   <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
   <script>
        $(document).ready(function(){ 
            $row = 0;
            $(".addRow").click(function(){
                $row = $row + 1;
              $('#row').append('<tr><td> \
                <input type="text" name="quantity[' + $row + '][1]" value="" maxlength="2" size="2"  /></td> \
                <td><select name="bulb_type_id[' + $row + '][2]"> \
                    <option value="1">Option 1</option> \
                    <option value="2">Option 2</option> \
                    <option value="3">Option 3</option> \
                </select></td> \
                <td><input type="checkbox" name="required[' + $row + '][3]" value="1"  /></td> \
                </tr>');
          });
        });
    </script> 
    
</head>
<body>

<table cellspacing="0">
<thead>
    <tr>
        <th>Qty</th>
        <th>Option</th>
        <th>Required ?</th>
    </tr>
</thead>
<tbody id="row">
    <tr>
        <td>    
            <input type="text" name="quantity[0][1]" value="" maxlength="2" size="2"  />
        </td>
        <td>    
            <select name="bulb_type_id[0][2]">
                                <option value="1">Option 1</option>
                                <option value="2">Option 2</option>
                                <option value="3">Option 3</option>
                </select>
            <? 
            //echo form_dropdown('bulb_type_id[0][2]', $bulb_types);
            ?>
        </td>
        <td>    
            <input type="checkbox" name="required[0][3]" value="1"  />
        </td>
    </tr>
</tbody>
</table>

<p><a href="#" class="addRow">Add another row</a></p>

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

JohnnyAuthor Commented:
works great now thanks
JohnnyAuthor Commented:
im sorry leakim971 i didnt see there was more then one helping on the question. want me to ask for 100 points for your contribution..

sorry the solution was the accepted answer but didnt realize the post you made leakim971 was a factor and a separate person(being two helping people)


leakim971PluritechnicianCommented:
Don't worry Pern. Thanks! Have a nice week-end!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
jQuery

From novice to tech pro — start learning today.