PDA

View Full Version : Ajax and forms



Mopo
03-09-2006, 06:53 PM
Hello! For first I am sorry for my English.
For second here is my question. Can I send form through ajaxpage and how does it look, if it is possibly? Form method is POST, because form data contents non-English caracters.
Thank you.

Twey
03-09-2006, 07:01 PM
See http://www.dynamicdrive.com/forums/showthread.php?p=28428.

Mopo
03-09-2006, 07:09 PM
Thanks! You are really God!

Twey
03-09-2006, 07:23 PM
Haha, glad to hear it :D

Mopo
03-10-2006, 10:34 AM
I am sorry, but I found some problems with that code...
For first Opera does not work with document.getElementById(formID).elements It is only on my computer?
For second data is not sending... in Fierfox javascript console is this message:

uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIXMLHttpRequest.send]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ajax.js :: ajaxpage :: line 46" data: no]

Can you help me?

Twey
03-10-2006, 05:13 PM
See the comment:
// formID needs to be the ID of your formReplace "formID" with the name of your form, in quotes.

Mopo
03-10-2006, 06:27 PM
I understood this, but it does not work in my Opera 8! I tried document.forms[formName] and document.formName and simply formName.elements, but does not work. Is the problem in my browser?

Twey
03-10-2006, 06:56 PM
It should work with Opera too.
Have a fish instead.

Mopo
03-10-2006, 07:42 PM
It is only on localhost in the meantime. But I will test it on different computers and on different versions of browsers.
Thank you for help.