Re: Next form element
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: Next form element

From: BootNic <Bootnic@bounce.prodigy.net>
Date: Thu Feb 02 2006 - 04:14:54 CET

> "Evertjan." <exjxw.hannivoort@interxnl.net> wrote:
> news:Xns975CCAA266368eejj99@194.109.133.242....
>
> BootNic wrote on 31 jan 2006 in comp.lang.javascript:
>
>> <button type="button" onclick="x.readOnly=(x.readOnly)?false:true;
>> x.focus(); x.select();">toggle readOnly</button>
>>
>
> A <button> is always a button.

If I were to put a button in a form without type="button", and it was
not the submit button, some browsers treat it as a submit button. I
usually add it for that reason.

IE 6 does not seem to have any issues with it.

FireFox 0.8.0
NetScape 7.2
Mozilla 1.7.12
Opera 8.51

All treat it as a submit button.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
</head>
<body>
<form id="a" name="a" action="http://www.google.com/search">
<input name="q" type="text" value="button collector"><br>
<button type="button" onclick="alert('hello')">Alert
Hello</button><br>
<button onclick="alert('Good Bye')">Alert Good Bye</button><br>
<input type="submit" value="Submit">
</form>
</body>
</html>

-- 
BootNic   Wednesday, February 01, 2006 10:12 PM
When I was young, I was put in a school for retarded kids for two
years before they realized I actually had a hearing loss...and they
called ME slow!
*Kathy Buckley*
Received on Tue Feb 7 21:30:52 2006