Board index   FAQ   Search  
Register  Login
Board index php forum :: HTML JavaScript

REQ: Making JS compatible with all browsers

Javascript coding ..

Moderators: macek, egami, gesf

REQ: Making JS compatible with all browsers

Postby ameenov » Tue May 16, 2006 7:21 am

This code is working only with IE Not with other browsers

((This code for adding a new textfield )) used in a script called (tell a friend) .. to make it possible for the site visitor to email more friends ..

--------------------------
Anyway .. In this code I don't know where is the part should I edit to make it compatible with all browsers
But I think (document.all) is one of the parts i should change ...
Any help will be appreciate

Code: Select all
function createForm(number) {
data = "";   
inter = "'";
if (number < 16 && number > -1) {
for (i=2; i <= number; i++) {
if (i < 10) spaces="      ";
else spaces="    ";
data = data + Friend" + i + " :" + spaces + "<input type='text' size=35 name='f[]'><br>";
}
if (document.layers) {
document.layers.cust.document.write(data);
document.layers.cust.document.close();
}
else {
if (document.all) {
cust.innerHTML = data;
      }
   }
}
else {
window.alert("Please select up to 15 entries.");
   }
}

//  End -->
</script>
User avatar
ameenov
New php-forum User
New php-forum User
 
Posts: 70
Joined: Mon Jun 13, 2005 2:03 am
Location: Bahrain

Postby gesf » Mon May 22, 2006 5:35 am

Yeh, you're right! Try replacing document.all with document.cust.
User avatar
gesf
Moderator
Moderator
 
Posts: 1717
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden


Return to JavaScript

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.