Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Gloogle Chlome

Name: Anonymous 2009-09-14 23:45

Cool thing:


<form name="formy">
<textarea name="display" rows="20" columns="20">LOL:</textarea>
<button name="whatever" onClick="document.formy.display.value = document.formy.display.value + '\nwhatever';">whatever</button>
</form>


This works as expected in IE, but not Chrome or Firefox

Name: Anonymous 2009-09-14 23:57

back to /g/, please

Name: Anonymous 2009-09-15 0:09

It's because your <button> is inside the form, and FF and Chrome have the button behave as <input type=submit>.  Move the button outside the form and it works the same in all three browsers.

Name: Anonymous 2009-09-15 0:14

Well now I don't know if I should hate IE for its lenient parsing or not.

Name: Anonymous 2009-09-15 0:23

According to:

http://www.w3.org/TR/html401/interact/forms.html#h-17.5

"submit" is the default type for <button>

Note that if you use <button name="whatever" type="button">, Firefox does not submit the form, and behaves just like IE.  I don't know why IE would take the default type to be "button"...do the IE devs just make shit up as they go along?

Name: Anonymous 2009-09-15 0:30

>>5
… do the IE devs just make shit up as they go along?
Yes. http://blogs.msdn.com/ieinternals/archive/2009/08/20/WinINET-IE-Cookie-Internals-FAQ.aspx

Name: Anonymous 2009-09-15 2:52

>>4
Well now I don't know if I should hate IE for its lenient parsing or not.

You should hate it for letting you believe that there was nothing wrong with that mistake you call ``code''.

Name: Anonymous 2009-09-15 4:37

>>6
Internet Explorer (including IE8) does not attempt to support any RFC for cookies.
LOL

Name: Anonymous 2009-09-15 5:15

>>8
RFC? More like Richard stallman's Frickin' COMMUNISM, amirite?

Name: Anonymous 2009-09-15 5:24

>>9
wat?

Name: Anonymous 2009-09-15 8:35

This means that directives like max-age, versioned cookies, etc, are not supported in any version of Internet Explorer.
Cool support, bro.

It’s worth mentioning that increased cookie limit actually broke the website of a major financial institution. The site depended on cookies beyond the 20 cookie limit getting dropped, and stopped working properly when the limit was increased.
Cool site, bro.

Name: Anonymous 2009-09-15 14:01

By the way, document.form.element.value is not the right way to access an element. You should use DOM instead. name attribute on form HTML elements is deprecated and not allowed on XHTML Strict, but still used on form elements as it's the "variable name" passed on POST/GET.

<script type="text/javascript">
  function $(id) { return document.getElementById(id); }
</script>
<form id="formy">
  <textarea name="display" id="formy_display" rows="20" columns="20">LOL:</textarea>
  <button type="button" id="formy_whatever" onclick="$('formy_display').value = $('formy_display').value + '\nwhatever'">whatever</button>
</form>

Name: Anonymous 2009-09-15 14:13

>>12

And to think; I believed it was disgusting before!

Name: Anonymous 2009-09-15 14:30

Use <input type="button"/> and/or onsubmit="return false;".

Name: Anonymous 2009-09-15 16:33

>>13
It can be worse:

<script type="text/javascript">
//<![CDATA[
  function updateTextArea() {
    var textarea = document.getElementById('formy_display');
    var currenttext = textarea.firstChild.nodeValue;
    var newtext = currenttext + '\nwhatever';
    textarea.removeChild(textarea.firstChild);
    textarea.appendChild(document.createTextNode(newtext));
  } //]]>
</script>
<form id="formy">
  <textarea name="display" id="formy_display" rows="20" columns="20">LOL:</textarea>
  <button type="button" id="formy_whatever" onclick="updateTextArea()">whatever</button>
</form>

Name: Anonymous 2009-09-15 17:13

>>12

>document.form.element.value is not the right way to access an element

This is just about enough reason to quit web development right there.

>>15

whywouldyoudothat.png

Name: Anonymous 2009-09-15 17:15

>>12
Isn't XHTML now being abandoned?

Name: Anonymous 2009-09-15 17:16

Sometimes I wish I was a programmer, so I could actually understand this thread. :(
______
If you believe in Jesus Christ and are 100% proud of it put this as your signature.

Name: Anonymous 2009-09-15 17:19

>>18
Get out, and take JC with you.

Name: Anonymous 2009-09-15 17:35

>>17
it should all be abandoned

Name: Anonymous 2009-09-15 23:43

>>15

What the hell is this?

Name: Anonymous 2009-09-16 0:02

>>21
VALID PERL CODE

Name: ​​​​​​​​​​ 2010-10-22 4:33

Name: Anonymous 2010-12-17 1:37

Erika once told me that Xarn is a bad boyfriend

Name: Anonymous 2011-02-03 6:07

Don't change these.
Name: Email:
Entire Thread Thread List