Click to See Complete Forum and Search --> : My code does not work on Mozilla
boskyvora
10-16-2003, 06:38 AM
Hi There!
I have a php file, most of the code in that file is javascript which seems to run fine in IE but does not work on Mozilla. What could be the problem.
I am attaching the file for the reference sake. Please have a look and lemme know ASAP as i'm totally lost n dunno what to do.
Regards
Bosky
Charles
10-16-2003, 06:44 AM
I think that you will find that your script fails for more MSIE users than all of the Netscape users. Don't make a JavaScript dependent site and then don't worry about Netscape.
boskyvora
10-16-2003, 07:05 AM
Hi There!
I dont think so its possible to replace the javascript with any-other language. Would u please have a look at the code and tell is there any other work around for the same code.
:confused:
Regards
Bosky
Khalid Ali
10-16-2003, 08:04 AM
You have not provided any resources to where we can look and tell you why your code might not work for Mozilla(my first guess will be that you have used document.all instead of document.getElementById),
Its rather rude to post a message like this and then expect a reasonable answer.
boskyvora
10-16-2003, 08:14 AM
Hi There!
I am sorry i did attach my file along with my first message. I guess something must have gone wrong while attaching it. I am reattaching my code as a text attachement. Sorry for the inconvinence. Just in case the file is not attached i will paste the function below. The following function receives the table as its parameter.
function addRow(id)
{
// Adds a row for selection
var tbody = document.getElementById
(id).getElementsByTagName("TBODY")[0];
var row = document.createElement("TR");
var td1 = document.createElement("TD");
field = document.createElement("SELECT");
field.setAttribute("className","normal_form_field");
field.name = "field_name";
field.id = "field_name";
field.attachEvent("onchange",disableChkbox);
// Fetching the fields from the values stored in an array stored in the settings file
<?php
$countadvSearchval = count($adv_search_value);
$i = 0;
while($i < $countadvSearchval)
{ ?>
option = document.createElement("OPTION");
option.value ="<?php print $adv_search_value[$i]?>";
option.text ="<?php print $adv_search_text[$i] ?>";
field.add(option);
<?php
$i= $i +1;
}
?>
td1.appendChild(field);
var td2 = document.createElement("TD");
td2.appendChild (document.createElement("<INPUT type='text' name='searchText' class='normal_form_field' size='20' onKeyPress='chkKey()'>"));
var td3 = document.createElement("TD");
opr = document.createElement("SELECT");
opr.setAttribute("className","normal_form_field");
opr.id="search_type";
opr.name="search_type";
option = document.createElement("OPTION");
option.value = "like";
option.text = "Like";
opr.add(option);
option = document.createElement("OPTION");
option.value = "=";
option.text = "Exact";
opr.add(option);
option = document.createElement("OPTION");
option.value = "!=";
option.text = "Not";
opr.add(option);
td3.appendChild(opr);
var td4 = document.createElement("TD");
rel = document.createElement("SELECT");
rel.setAttribute("className","normal_form_field");
rel.id = "relation";
rel.name = "relation";
option = document.createElement("OPTION");
option.value = "--";
option.text = " ";
rel.add(option);
option = document.createElement("OPTION");
option.value = "AND";
option.text = "AND";
rel.add(option);
option = document.createElement("OPTION");
option.value = "OR";
option.text = "OR";
rel.add(option);
td4.appendChild(rel);
row.appendChild(td1);
row.appendChild(td2);
row.appendChild(td3);
row.appendChild(td4);
tbody.appendChild(row);
}