If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

prototype form submission

hi guys I need a prototypr function to submit my form but I need it to be an onclick="" one cause I use a function to call forms come in to a div in html code and I understood that the javascripts does not redetect forms and divs in my page

Updater will handle creating the request and post the values from your form to the php page you specify. Upon return, it will update the container you specify with the results. There are actually a LOT more options and callbacks you can use, but this basic example should get you going.

If you want to you can include all of this in a function so you can call it all over the page if you so desire.

you have an event observer acting on the form you're submitting with updater, i don't have any idea why you'd do that but it sure would cause a conflict.

don't use void... don't use a link or a submit or whatever at all. just make a regular button or something and use an onclick event to call the function. then it would probably avoid that observer because it isn't submitting in the traditional sense.

bottom line, updater is normally super easy to use. i don't know how you're generating these forms (and i've never seen form-key or isAjax used as a param before, nor are they in the API that i see) but you must be hitting a conflict with some of your older code somehow. the fact that it worked on a test page but spazzed out on you on the main page supports this.

the page is kind of a mess. out of general principle i'd say you might consider a clean start for it. are you really using everything that's in there? could it be cleaned up to remove the potential for conflict? i'd suggest re-evaluating what your page needs to do and building the logic from the bottom up again. it looks to me like you have redundant stuff in there.

at the very least, just take a look at what you need your js to do. i think you'll find you can do a lot more with a lot less.

and once again, you need those values you're passing in quotes... i see you forgot that again.

if you'll make a list of things you need your js to do throughout the flow of the page i'd be happy to show you what i think might be the best way to accomplish those goals.