Page 1 of 1

Stupid problem with this.form.submit()

Posted: Sat Sep 17, 2005 7:30 am
by jmut
hi,
Using FF 1.06
I have the following code...

Code: Select all

<form name="myform" action="" method="post">
  <select id="navigaiton_menu" name="navigation_type" onchange="this.form.submit();">
    <option label="Booking Conditions" value="Booking Conditions" selected="selected">Booking Conditions</option>
    <option label="Cancelation Policy" value="Cancelation Policy">Cancelation Policy</option>
    
    <option label="FAQ" value="FAQ">FAQ</option>
    <option label="BG Guide" value="BG Guide">BG Guide</option>
    <option label="BG Intro" value="BG Intro">BG Intro</option>
    <option label="Travel Tips" value="Travel Tips">Travel Tips</option>
    <option label="About Us" value="About Us">About Us</option>
    <option label="Terms and Conditions" value="Terms and Conditions">Terms and Conditions</option>
    </select>
</form>
Can someone explain to me why this is not working all the time? What it depends on.
So if I separate this code it works like a charm....when I integrate it in a file with other forms etc....it is not working.
I checked for duplicated names,ids but couldn't find one
I sometimes get this error on Javascript Console
Error: this.form.submit is not a function

I am a bit new to JS thats why I address the forum for help
Thanks in adavnce.

Posted: Sat Sep 17, 2005 7:47 am
by n00b Saibot
maybe try :arrow: document.myform.submit()

Posted: Sat Sep 17, 2005 7:51 am
by jmut
n00b Saibot wrote:maybe try :arrow: document.myform.submit()
no success :(
And shouldn't this.form.submit() work always.
Why trying with different approach.
Is there known flaw in the browser concerning this?

Posted: Sat Sep 17, 2005 7:59 am
by n00b Saibot
jmut wrote:
n00b Saibot wrote:maybe try :arrow: document.myform.submit()
no success :(
And shouldn't this.form.submit() work always.
Why trying with different approach.
Is there known flaw in the browser concerning this?
Ya, what you say is true, but the prob is this that js implementation in terms of DOM and event-handling is different on different browsers. Thats why writing cross-browser compliant scripts is a real PITA. The scripts that run beautifully on one turns up nasty in another browser...

Posted: Sat Sep 17, 2005 8:01 am
by feyd
it may be whining about the empty action attribute...

Posted: Sat Sep 17, 2005 8:16 am
by jmut
well, I already added a submit button :(
Its not the empty action attribute that caused the problem.
Thanks for help. I was thinking I missed something fundamental here thats why I posted.
Will investigate the problem when got time.
10x again.