I am trying to build a system like when any user clicks on an "Add" button, it creates two text fields and two drop down selects automatically. I searched on google for the tutorial but all I have managed to find is only how to add text fields, but I need to add Select drop down with remove option.
I have some knowledge in PHP but little in Javascript or Jquery.
Would you please kindly help?
Here is the code that I have found:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script>
function generateRow() {
var d=document.getElementById("div");
d.innerHTML+="<p><input type='text' name='food'>";
var e=document.getElementById("div");
e.innerHTML+="<input type='text' name='food'>";
}
</script>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<label>
<input name="food" type="text" id="food" />
</label>
<div id="div"></div>
<p><input type="button" value="Add" onclick="generateRow()"/></p>
<p>
<label>
<input type="submit" name="Submit" value="Submit" />
</label>
</p>
</form>
</body>
</html>