PDA

View Full Version : problem with FireFox



krishna123
Apr 16th, 2007, 07:12 AM
Hi ,
I am generating one combo box and 3 text boxes when a button is clicked. These combo box and 3 text boxes are comming in one line in IE. But when i tried in FireFox i am getting in separate lines.
Here is my code.

<tr>
<script type="text/javascript">

function addEvent(request)
{

if(request == '<%= RuleSessionManager.GroupingRulesParameters.RULES%>')
{
{
var ni = document.getElementById('myDiv');
var numi = document.getElementById('add');
var num = (document.getElementById('add').value -1)+ 2;
numi.value = num;
var divIdName = "my"+num+"Div";
if(num>1)
{
var oldName = "my"+(num-1)+"Div";
var ndiv=document.getElementById(oldName);

// ndiv.innerHtml+="<select><option>AND</option><option>OR</option></select>";
}

var newdiv = document.createElement('div');
newdiv.setAttribute("id",divIdName);
var html="<td><select NAME='";
html=html + "<%= RuleSessionManager.GroupingRulesParameters.RULES %>"+"'>"+" <OPTION VALUE=''>-- Select Rule --</OPTION>";
<%
Iterator ruleIterator = ruleList.iterator();
while(ruleIterator.hasNext())
{
String ruleName = ruleIterator.next().toString();
System.out.println("ruleName %%%%"+ruleName);
%>
html +="<option value='"+"<%= ruleName %>"+"'>"+"<%= ruleName%>" +"</option>";
<%
}
%>
html +="</SELECT></td><td><input name ='textBox1' type='text'></td><td><input name ='textBox2' type='text'></td> <td><input name ='textBox3' type='text'></td>";
html+="<td><input type='button' name='remove' value ='remove' onclick ='removeEvent("+num+");'></td>";


newdiv.innerHTML = html;
ni.appendChild(newdiv);
}

}
}
function removeEvent(divNum)
{
var d = document.getElementById('myDiv');
var name = "my"+divNum+"Div";
var olddiv = document.getElementById(name);
d.removeChild(olddiv);
}

</script>
</tr>


I dont know whats going wrong in FireFox. Its very urgent for me.


regards,
Krishna

nikkiH
Apr 16th, 2007, 03:07 PM
Firefox is much less forgiving of invalid html.
You cannot append a td to a div.