JQuery append will not add <form name='form1' id='form1' action='my.php' method='post'> dynamically
hi,
In my program I want to add a form and list box dynamically. The select and options tags are appended without problem and the list box is created. However, when I try to append the <form> tag it does not happen. Here is the code:
- <body>
<div class=.results>
<script type="text/javascript" >
function showData(data) {
$("div.results").append('<p><b>Choose a Database Table</b></p>');
// $("div.results").append("<form name='tblform' id='tblform' action='' method='post'>" )
$("div.results").append('<select id="tblbx" name="tables" size="5">');
$.each(data, function (index, value) {
$.each(value, function (a, b) {
if (b=='sqlite_sequence') {
return false;
}
$("#tblbx").append('<option value='+b+'>'+b+'</option><br />');
});
$("div.results").append("</select>");
// $("div.results").append("/<form>");
});
} // show
// WHEN $("div.results").append(various form items) IS UN-COMMENTED this does not work.
What I want to do is get the selected option and send it back to the calling page.