shibby1011ph
01-10-2003, 07:18 PM
var el=event.srcElement.parentElement;
document.el.submit();
this has an error but i dont know what it is... please help...tnx=)
Admin warning Please use a more descriptive subject in the future. See: http://www.codingforums.com/postguide.htm
beetle
01-10-2003, 09:34 PM
el should contain a complete reference to the form. No need to prefix it with document.
var el=event.srcElement.parentElement;
el.submit();
However, I must ask, what IS the srcElement here? If it's an INPUT, TEXTAREA, or SELECT, you don't need to do that. Is this in a function? How is the function called?
shibby1011ph
01-14-2003, 02:11 AM
heres a part of the code where the el comes from:
function gotoform()
var el = event.srcElement.parentElement;
el.submit();
<select name="rating" onChange="gotoform();">
</select>
since el is the select tag, i want to submit the form where the select tag belongs.
beetle
01-14-2003, 03:15 AM
Why not just...
<select name="rating" onChange="this.form.submit();">
</select>
???
Adam20002
01-14-2003, 11:25 PM
Or if you do have to go into the gotoform() function for other reasons that arent apparent in the snippet you have posted just use :-
<select name="rating" onChange="gotoform(this)";>
</select>
functiuon gotoform(t)
{
....
....
t.form.submit();
}
Adam