Hola tengo este problema en
inserto opciones a un select
todo funcionan bien en explorer
pero en mozilla no, ni en firefox
alguien me puede decir que debo hacer
o si alguien sabe de algo exactamente como lo estoy haciendo
en el ejemplo
ejemplo:
<?
echo $_POST['campaign_id']."<br>";
echo $_POST['questiontext']."<br>";
$size_lista = sizeof($_POST['answers']);
echo "arreglo es de: ".$size_lista;
?>
<html>
<head><title>Comdev One Admin 3.0</title></head>
<link rel=stylesheet type=text/css href="adminstyle.css">
<script language=javascript>
function addAnswer(answervalue){
if (answervalue != ""){
var opt = new Option(answervalue,answervalue);
document.thisform.answer.options.add(opt);
var oNewItem = document.createElement("INPUT");
document.thisform.children(0).insertAdjacentElemen t("afterBegin",oNewItem);
oNewItem.type = "TEXT";
oNewItem.name = "answers[]";
oNewItem.value= answervalue;
oNewItem.style.display= "none";
document.thisform.answervalue.value="";
document.thisform.answervalue.focus();
}
}
function deleteAnswer(){
var answerlist = document.thisform.answer;
for(var i=0; i<answerlist.options.length; i++) {
if(answerlist.options[i].selected && answerlist.options[i] != "") {
document.thisform.elements(answerlist.options.leng th-i-1).removeNode();
answerlist.options[i]= null;
break;
}
}
}
</script>
<body topmargin=0 leftmargin=0 bgcolor="#FFFFFF">
<table border=0 cellpadding=2 cellspacing=0 width=98% align=center>
<form name=thisform action="form.php" method=post>
<input type=hidden name=pageaction>
<input type=hidden name=question_id value="">
<tr>
<td colspan=2><br>
<br></td>
</tr>
<tr>
<td valign=top width=20%>Campaign</td>
<td>
<select name=campaign_id>
<option value="" >Choose Campaign ...</option>
<option value="1" >Vote Campaign 1</option>
<option value="2" >Vote Campaign 2</option>
<option value="3" selected>programacion en php</option>
</select></td>
</tr>
<tr>
<td valign=top>Question</td>
<td><input type=text name=questiontext id=questiontext style="width:330px" value=""></td>
</tr>
<tr>
<td valign=top>Answers</td>
<td>
<table border=0 cellpadding=0 cellspacing=0>
<tr>
<td><input name=answervalue style="width:160px">
<input name="button" type=button onclick="addAnswer(document.thisform.answervalue.v alue)" value="Add">
<input name="button" type=button onclick="deleteAnswer()" value="Del"></td>
</tr>
<tr>
<td><select size=5 name=answer style="width:230px">
</select></td>
</tr>
</table></td>
</tr>
<tr>
<td valign=top></td>
<td>
<input name="button" type=button onclick="document.thisform.pageaction.value='add'; document.thisform.submit()" value=" Add ">
</td>
</tr>
</form>
</table>
</body>
</html>