hey friend i am trying to use automatic html input creation using java script for my new project ....
my problem is the field "type propositon 1:is it answer? ignore this one:" not come into input variable such as $_POST['prop1']
i used and the result was
Code:
Array ( [radio1] => on [cid] => 65 [desc] => dfdfdfdfd [submit] => Submit )
why my javascript created input field come into role?
my php html code is
PHP Code:
<table>
<form action="new.php" method="post">
<tr><td>
question type:<br />
True or False:<input type="radio" name="radio1">
Objective:<input type="radio" name="radio2">
Other:<input type="radio" name="radio3" >
</td></tr>
<textarea name="desc" rows="6" cols="35" ></textarea> <br />
<a href="javascript:add()" ><b>add proposition</b></a>
<div id="cat"></div>
<div id="num" style="display:none;"></div>
<br> </table>
and the java script is ...
PHP Code:
<script language="javascript" type="text/javascript">
function add()
{
k=document.getElementById("num").innerHTML
k=parseInt(k);
if(!k)
{document.getElementById("num").innerHTML=1;
k=1;}
else{
document.getElementById("num").innerHTML=k+1;
k++;
}
document.getElementById("cat").innerHTML+="<tr><td>type propositon "+(k)+":<input type=\"text\" name=\"prop"+k+"\"><td>is it answer? </td> <td> <input type=\"checkbox\" name=\"ans"+k+"\"></td><td><td> ignore this one:</td><input type=\"checkbox\" name=\"ign"+k+"\"></td></td></tr><br>"
}
</script>
Bookmarks