PDA

View Full Version : this simple code works in firefox, but doesn't work on googlecrome, can anyone fix?



smansakra
02-11-2009, 08:16 AM
this simple code works in firefox, but doesn't work on googlecrome, can anyone fix?


function save_select_image(media_id, str_action)
{
document.getElementById("icon_for_member").value = str_action;
document.getElementById("media_id").value = media_id;
document.forms["mood_icons_form"].action = "processing/moodGeneral.php?select_image=on";
document.forms["mood_icons_form"].target = "mood_process";

document.forms["mood_icons_form"].submit();
}


the googloe crome inspector said :


Uncaught TypeError: Object #<a NodeList> has no method 'submit' http://smansakra.jwnmedia.com/smansakra.net.tc/a.php (line 157)

can anyhone here help to tix this code?

thanks

smansakra
02-11-2009, 08:39 AM
does google crome not support this below code?

document.forms["mood_icons_form"].submit();

jscheuer1
02-11-2009, 04:06 PM
does google crome not support this below code?

document.forms["mood_icons_form"].submit();

In general, Chrome does support it. There is some other problem. For instance, there appears to be no form on that page by that name.

smansakra
02-12-2009, 01:34 AM
In general, Chrome does support it. There is some other problem. For instance, there appears to be no form on that page by that name.

hello.... john..
the form is on my page, all are ok on firefox, ie, and opera, but it is error on crome, ok i will investigate it..

jscheuer1
02-12-2009, 05:56 AM
I couldn't find the form in your source code.

smansakra
02-13-2009, 03:53 AM
I couldn't find the form in your source code.

john, my form is visible just for member only, i will fix it my self,

i think becouse crome is still new and it's first release, so it's not as powerfull as firefox

jscheuer1
02-13-2009, 06:20 AM
It's not a matter of power. Chrome is similar to Safari and other KHTML based browsers. Yes these are different than Firefox which is based on the Mozilla browser code. And, yes Firefox has add ons that give it perhaps the most utility of any browser. However, I tested the the document.forms['form_name'].submit() method in Chrome, and it works just fine in that browser. So, as I say, there must be some other problem.

smansakra
02-13-2009, 07:51 AM
hum, you're right, it always still error...

my code must be not tidy