| View previous topic :: View next topic |
| Author |
Message |
montanarry
Joined: 13 May 2006 Posts: 175
|
| What? |
| |
|
|
|
|
Klimapol
Joined: 27 May 2006 Posts: 134
|
| Nothing about it "just works" |
| |
|
|
montanarry
Joined: 13 May 2006 Posts: 175
|
Why cant he put event listener
If the html sends the form after enter
Then block it with the <form onSubmit="return false;">
I still bet 20 that it has to be this way  |
| |
|
|
Koplaf
Joined: 28 May 2006 Posts: 130
|
| montanarry, That's an easy bet for you to make, being as none of us is on hand to collect. |
| |
|
|
Poolkop
Joined: 01 Jun 2006 Posts: 123
|
| montanarry,Using unobtrusive javascript also means not using html attributes to attach event handlers |
| |
|
|
montanarry
Joined: 13 May 2006 Posts: 175
|
Yeah easy cause i wont be able to collect money from you
Poolkop, why html atributes...
He can also do somewhere a script.. form.onSubmit=function
Or he cant ? |
| |
|
|
Koplaf
Joined: 28 May 2006 Posts: 130
|
| montanarry,However, I believe you're basically saying the same thing. make the onSubmit event handler be the function that does your XHR juju, and then returns false. In the absense of JS, submit will do it's thing. Of course, then you'll want to do be careful to do your layering right server side. |
| |
|
|
Poolkop
Joined: 01 Jun 2006 Posts: 123
|
| He can, and he should. I think you forgot to read my negation |
| |
|
|
optomeb
Joined: 19 May 2006 Posts: 113
|
| How exactly do I cancel the event? |
| |
|
|
Koplaf
Joined: 28 May 2006 Posts: 130
|
| optomeb, If the event handler you use returns false, you should be golden. |
| |
|
|
|