By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,748 Members | 1,338 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,748 IT Pros & Developers. It's quick & easy.

Form Woes !

P: n/a
Hi Chaps,

I have been looking around the internet and I really can't see what I'm
doing wrong here !

This code works in firefox, but not internet explorer.

Any suggestions please? Internet Explorer just doesnt update the action
of the form so when you hit the button - it seemingly just refrehes the
page!

<form name="actions" action="" method="post">
<select name="action" class="formBox">
<option value="null" onclick="this.form.action.value='';">Select Action
From List
<option value="resendActEmail"
onclick="this.form.action.value='./admin_process.php?a=resend';">Re-Send
Activation Email
<option value="deletaccount"
onclick="this.form.action.value='./admin_process.php?a=delete';">Delete
This Account
</select>
<input class="formBox" type="submit" name="submit" value="Go">
</form>

Thanks,

Leon
Feb 13 '07 #1
Share this Question
Share on Google+
7 Replies

P: n/a
VK
On Feb 13, 10:22 pm, Leon <l...@dontcallmeeeore.co.ukwrote:
Hi Chaps,

I have been looking around the internet and I really can't see what I'm
doing wrong here !

This code works in firefox, but not internet explorer.
IE has a severe name resolution flaw in forms.
btw thanks for remainding - for records I gonna check if this ugliness
was finally fixed in IE7 (1:10 by my estimate :-(

For the time being NEVER EVER name form controls same names as default
attributes and methods of form itself.

As a side comment: onclick listener for option element is not a
documented feature, so some browsers may implement it and some not.
<select onchange="myfunction(this.options[this.selectedIndex].value)"
is the universally supported alternative.

<form name="actions" action="" method="post">
<select name="MyAction" class="formBox">
<option value="null" onclick="this.form.action.value='';">Select
Action From List
<option value="resendActEmail" onclick="this.form.action.value='./
admin_process.php?a=resend';">Re-Send
....
</select>
<input class="formBox" type="submit" name="MySubmit" value="Go">
</form>

Feb 13 '07 #2

P: n/a
VK wrote:
On Feb 13, 10:22 pm, Leon <l...@dontcallmeeeore.co.ukwrote:
>Hi Chaps,

I have been looking around the internet and I really can't see what I'm
doing wrong here !

This code works in firefox, but not internet explorer.

IE has a severe name resolution flaw in forms.
btw thanks for remainding - for records I gonna check if this ugliness
was finally fixed in IE7 (1:10 by my estimate :-(

For the time being NEVER EVER name form controls same names as default
attributes and methods of form itself.
Yeah - i noticed this already and updated - thanks :-)
>
As a side comment: onclick listener for option element is not a
documented feature, so some browsers may implement it and some not.
<select onchange="myfunction(this.options[this.selectedIndex].value)"
is the universally supported alternative.
would i need to make the value of each option equal to the URL i want it
to go to then ?

Eg..

<select name="myselect" action="" method="post"
onchange="myfunction(this.options[this.selectedIndex].value)">

<option value="admin_process.php?a=resend">Resend

</select>

?
>
<form name="actions" action="" method="post">
<select name="MyAction" class="formBox" >
<option value="null" onclick="this.form.action.value='';">Select
Action From List
<option value="resendActEmail" onclick="this.form.action.value='./
admin_process.php?a=resend';">Re-Send
...
</select>
<input class="formBox" type="submit" name="MySubmit" value="Go">
</form>

Thanks,

Leon
Feb 13 '07 #3

P: n/a
VK
On Feb 13, 11:21 pm, Leon <l...@dontcallmeeeore.co.ukwrote:
would i need to make the value of each option equal to the URL i want it
to go to then ?

Eg..

<select name="myselect" action="" method="post"
onchange="myfunction(this.options[this.selectedIndex].value)">

<option value="admin_process.php?a=resend">Resend

</select>
Yes. There is an usability impact in either case - because of bias
against keyboard users. On come UAs onchange fired on each scroll
using arrow keys. On other UAs onchange is fired if Enter is pressed
with select having focus. That means that users have to use mouse to
be able to scroll, and still a danger of an "occasional navigation" is
rather high. I'm sure youselve at least once navigated on some site
while simply studying the list of options. IMHO - but yours of decide
of course - "active select" is a sample of intended convenience which
is on practice a big disconvenience. A nice confirmation button near
of "passive select" will require one extra click from your users but
it will save a lot of nerves to them.

Feb 13 '07 #4

P: n/a
VK wrote:
On Feb 13, 11:21 pm, Leon <l...@dontcallmeeeore.co.ukwrote:
>would i need to make the value of each option equal to the URL i want it
to go to then ?

Eg..

<select name="myselect" action="" method="post"
onchange="myfunction(this.options[this.selectedIndex].value)">

<option value="admin_process.php?a=resend">Resend

</select>

Yes. There is an usability impact in either case - because of bias
against keyboard users. On come UAs onchange fired on each scroll
using arrow keys. On other UAs onchange is fired if Enter is pressed
with select having focus. That means that users have to use mouse to
be able to scroll, and still a danger of an "occasional navigation" is
rather high. I'm sure youselve at least once navigated on some site
while simply studying the list of options. IMHO - but yours of decide
of course - "active select" is a sample of intended convenience which
is on practice a big disconvenience. A nice confirmation button near
of "passive select" will require one extra click from your users but
it will save a lot of nerves to them.
There are only actually 2 users who will be using the select boxes, one
is myself. The problem is - I use Firefox, the other guy uses Internet
Explorer !

I tried to implement your suggestion - with no luck !

<script language="javascript">
function myfunction(gourl) {
document.test.submit.value=gourl;
}

</script>
<form name="test" action="" method="post">
<select name="myselect" action="" method="post"
onchange="myfunction(this.options[this.selectedIndex].value)">

<option value="admin_process.php?a=resend">Resend

</select>
<input class="formBox" type="submit" name="submit" value="Go">
</form>

Leon
Feb 13 '07 #5

P: n/a
VK
On Feb 13, 11:43 pm, Leon <l...@dontcallmeeeore.co.ukwrote:
I tried to implement your suggestion - with no luck !

<script language="javascript">
function myfunction(gourl) {
document.test.submit.value=gourl;

}
submit is method, not a field.

function myfunction(gourl) {
document.forms['test'].action = gourl;
document.forms['test'].submit();
}

On cold turkey I do not remember if all browsers are smart to resolve
the partial URL against the current page URL. In case if make a
complete URL yourself:

function myfunction(gourl) {
document.forms['test'].action = "http://www.foo.bar/" + gourl;
document.forms['test'].submit();
}

Feb 13 '07 #6

P: n/a
VK wrote:
On Feb 13, 11:43 pm, Leon <l...@dontcallmeeeore.co.ukwrote:
>I tried to implement your suggestion - with no luck !

<script language="javascript">
function myfunction(gourl) {
document.test.submit.value=gourl;

}

submit is method, not a field.

function myfunction(gourl) {
document.forms['test'].action = gourl;
document.forms['test'].submit();
}

On cold turkey I do not remember if all browsers are smart to resolve
the partial URL against the current page URL. In case if make a
complete URL yourself:

function myfunction(gourl) {
document.forms['test'].action = "http://www.foo.bar/" + gourl;
document.forms['test'].submit();
}
oops that submit shouldnt have been in there - was just me testing to
see if i could update the submit button value.

I'll give it a go and report !

Thanks,

Leon
Feb 13 '07 #7

P: n/a
Leon said the following on 2/13/2007 3:43 PM:
VK wrote:
>On Feb 13, 11:21 pm, Leon <l...@dontcallmeeeore.co.ukwrote:
>>would i need to make the value of each option equal to the URL i want it
to go to then ?

Eg..

<select name="myselect" action="" method="post"
onchange="myfunction(this.options[this.selectedIndex].value)">

<option value="admin_process.php?a=resend">Resend

</select>

Yes. There is an usability impact in either case - because of bias
against keyboard users. On come UAs onchange fired on each scroll
using arrow keys. On other UAs onchange is fired if Enter is pressed
with select having focus. That means that users have to use mouse to
be able to scroll, and still a danger of an "occasional navigation" is
rather high. I'm sure youselve at least once navigated on some site
while simply studying the list of options. IMHO - but yours of decide
of course - "active select" is a sample of intended convenience which
is on practice a big disconvenience. A nice confirmation button near
of "passive select" will require one extra click from your users but
it will save a lot of nerves to them.

There are only actually 2 users who will be using the select boxes, one
is myself. The problem is - I use Firefox, the other guy uses Internet
Explorer !

I tried to implement your suggestion - with no luck !

<script language="javascript">
function myfunction(gourl) {
document.test.submit.value=gourl;
}
document.test.action=gourl

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?
Feb 13 '07 #8

This discussion thread is closed

Replies have been disabled for this discussion.