Thread: AJAX Problem
View Single Post
08-28-2007, 10:58 AM
#4
Salathe is offline Salathe
Salathe's Avatar
Status: Community Archaeologist
Join date: Jul 2004
Location: Scotland
Expertise: Software Development
Software: vim, PHP
 
Posts: 3,820
iTrader: 25 / 100%
 

Salathe will become famous soon enough

Send a message via MSN to Salathe

  Old

Originally Posted by CreativeLogic View Post
If it's in the form use onsubmit within the form tag.
Or, unobtrusively attach the submit handler onload/domready. You're using Prototype so it's easy to do that using Event.observe, also make use of the $ function rather than document.getElementById.

If you use the form's submit event, there's no need to look for which key was pressed, playing with the submit button, etc.