473,396 Members | 1,773 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Form Woes !

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
7 1990
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: descds | last post by:
OK im prety much a newbie at PHP but it has me hooked. Im writing a comment system for one of our modules on phpnuke. Its all going very well, well should i say WAS going very well :) Ok all...
2
by: Tommyj | last post by:
Hi all, Ok, any help on this would be great, or a pointer in the right direction if not! I have a form thats generated on the fly from an Access DB, there's a number of tick boxes on it, but,...
1
by: nathan | last post by:
Good morning folks. Here at work, we have an access db used in HR. They have a form where they add in new employees. In the 'badge number' (employee #) text box they have always entered 4 digit...
1
by: Robert Neville | last post by:
I am having some trouble with some old code revolving around custom form navigation buttons. My main form has a sub-form with these custom navigation buttons. In other words, the code should be...
3
by: David Cuffee | last post by:
I am a VB6 programmer learning C#. I probably would have been better off being totally new to programming learning C# because of my knowledge of VB6 is totally making this harder for me to grasp. ...
5
by: RSH | last post by:
My form woes continue...I have a Parent form that hides itself when one if it's child forms are spawned. My problem is that I need the child form to unhide the parent form when it is being closed....
19
by: Jamey Shuemaker | last post by:
I'm in the process of expanding my knowledge and use of Class Modules. I've perused MSDN and this and other sites, and I'm pretty comfortable with my understanding of Class Modules with the...
4
by: =?Utf-8?B?VkIgSm9ubmll?= | last post by:
I am at my witless end here, please help! I have an ASP.Net aspx web page, hosted on Windows Server 2003, that receives a query string with the path to an autocad drawing file selected from a...
3
by: ClanKeithROoF | last post by:
I'm working on a calendar that works well in all points except one. I found the code online and modified it to fit my needs. One of my mods isn't working. I'm trying to make it display the chosen...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.