Link to home
Start Free TrialLog in
Avatar of Richard Quadling
Richard QuadlingFlag for United Kingdom of Great Britain and Northern Ireland

asked on

AJAX Form submit without refresh.

I have a small form which a user will sit in front of for an hour or so, entering some data from faxes. The form contains several selections which take a while to determine.

I want to be able to submit the form via AJAX and not have a refresh which will then need to go and get all the select data again. Yeah, I could cache it, but I'd rather have the form on the screen, the user enters the data and presses "submit" and they're told "OK" or "something went wrong" sort of thing. If it is OK, then the form is cleared and ready for the next lot of data and the fax is put into 1 pile. If something went wrong it goes into another pile.

The code is intranet only.

I'm using prototype.js V1.5.1.1

How do I submit a form via AJAX, and NOT have the form refresh?


Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

ASKER CERTIFIED SOLUTION
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Richard Quadling

ASKER

Ha. I've got a printed manual and it is only V1.5.0, so that's why I missed it.

Ha ha!

The mySubmit function is called how?
Please reload. I added it a minute later
Ha. OK. I think this is why mine is broken. I'm using ...

Event.observe('fleetForm', 'submit', mySubmit);

And this adds mySubmit to the onSubmit to do list,rather than replaces it. So even returning false in mySubmit is not having the effect I wanted.

Trying onSubmit="..." now ...
All done. Thanks.