R
Rob
I am having an issue where I have multiple forms on a page. The first
form has a couple of hidden inputs. The second form has all the
visible controls including three buttons. Each of these buttons has a
behaviour attached to it (From Ben Nolan's Behaviour.js) based on its
id. The code for the first button is something like this (I am also
using prototype.js):
var button1Func = function(event)
{
alert("I am in button1Func");
$('secondForm').submit();
};
Behaviour.register(
{
'#button1': function(element)
{
Event.observe(element, 'click', button1Func);
}
});
When the button is clicked, an alert pops up saying "I am in
button1Func", but then the status bar says it is calling the action
for the first form and not the second. When I move the first form to
the bottom of the page, the first button works correctly. What is
going on here? It seems to work ok in FF2 and IE7.
Thanks,
Rob
form has a couple of hidden inputs. The second form has all the
visible controls including three buttons. Each of these buttons has a
behaviour attached to it (From Ben Nolan's Behaviour.js) based on its
id. The code for the first button is something like this (I am also
using prototype.js):
var button1Func = function(event)
{
alert("I am in button1Func");
$('secondForm').submit();
};
Behaviour.register(
{
'#button1': function(element)
{
Event.observe(element, 'click', button1Func);
}
});
When the button is clicked, an alert pops up saying "I am in
button1Func", but then the status bar says it is calling the action
for the first form and not the second. When I move the first form to
the bottom of the page, the first button works correctly. What is
going on here? It seems to work ok in FF2 and IE7.
Thanks,
Rob