If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

differences beetween browsers

Hello everybody. I'm new here and I would really need some help.
I have a form which sends SMS to mobiles. Inside this form there is a button that makes a hidden div visible with data coming with ajax (contacts of the user). This data is inside a form which is inside a table all made with javascript. So we choose the contacts that we want to send the sms (with checkboxes) and then click on another button which will put the data of the choosen contacts inside my first form and hide the div. So when this button is clicked, it's going to a function. The first thing I want is to get the length of the form of the hidden/visible div and I'm doing this with an alert(document.contact_form.length) to see if it is there. In mozilla this alert does not work.An alert with a string works fine so it goes to the function.
In chrome and safari works but the problem here is that it completes the first form!!! that sends the SMS and stores the data in the database.?.

Could anybody help me or if you know where I could search for these kind of differences?

Think I found what is going on. I asked the alert to bring me the elements of the sms_form, the one that contains the button which calls the clicked() function.
In chrome and safari shows me the number 8 meaning the exact elements I have in my HTML in sms_form.
In mozilla it gives me number 13 meaning the elements in sms_form plus the elements in contact_form.
So I think I will have to make different script for each one of them. Right?

Mozilla does not see this form. It adds the elements of this form in the sms_form. Strange?

Not quite very strange. innerHTMLis not a standard DOM method. It is unpredictable: it will not always add the new elements into the DOM tree. You should probably switch to DOM methods, instead of innerHTML.

The <input type="button"> creates a text input. I read somewhere that browsers that don't understand script will do that. I don't really understand what it means. As for the DOM method I think I'm going to try it.

The other problem I have is with safari and chrome.
I'm attaching the hole script if you can find anything.

In Saf, Chr when I click the button name="select" which is created inside clicked(), it executes the insert_mobile() function, then it executes the hole script from the begging (the init() function), and then it goes to PHP as if I clicked the submit button in sms_form and tries to store the non existing data into my database.

In mozilla it executes the insert_mobile() function only if I don't choose any of the contacts, it does't exexute the hole script again but if I choose contacts it does nothing.

I think I'm going very deep for a begginer.
Thanks anyway for your time.