modify this code to add more combo boxes
Hi,
I have the following code.. It's adding (creating) a hobby textbox when clicking the link.
- <script type="text/javascript">
- var counter = 0;
- $(function(){
- $('p#add_field').click(function(){
- counter += 1;
- $('#container').append(
- '<strong>Hobby No. ' + counter + '</strong><br />'
- + '<input id="field_' + counter + '" name="dynfields[]' + '" type="text" /><br />' );
- });
- });
- </script>
I also have the following code:
- <div id="container">
- <select name="cboResidenceLocation" id="cboResidenceLocation" style="width: 100%">
- <option value="">[Unspecified..]</option>
- <?php
- $mysql_command = "CALL sp_populate_country()";
- $mysql_query = $mysql_connection->prepare($mysql_command);
- $mysql_query->execute();
- while($mysql_row = $mysql_query->fetch())
- {
- ?>
- <option value="<?php echo $mysql_row['country_code_alpha2']; ?>" <?php if ($mysql_row['country_code_alpha2'] == $company_country) { echo 'selected'; } ?>><?php echo $mysql_row['country_name']; ?></option>
- <?php } ?>
- </select>
- <br>
- </div>
How can I let the Add More link to create new
cboResidenceLocation instead of creating the textbox?