15 Sep, 2006

Published at 05:24AM

Tagged with problems, work, rails, and ajax

This post has 0 comments

The form has no properties

Programming is a challenge. I understand that. Problems will arise no matter what environment you’re in or language you’re using. But I like it more when the challenge comes from something I don’t know how to do rather than something I’ve done hundreds of times, and today decides to not work. I know the application or program only knows what you tell it to do, but sometimes things get hard to troubleshoot.

What I’m trying to do is render a partial via ajax and submit the form via ajax. No big deal at all. I’ve done this so many times, but now I’m getting “the form has no properties.” I can’t seem to get the data out of the form, so it thinks there’s nothing to submit. I tried the ajax request within the form tag as well as an external link to submit the form and serialize the data based on the form ID. Neither one worked and I’ve done both methods in the past. This past week, actually. The odd thing is, the form will submit without the ajax. That doesn’t make sense to me. It’s the same code. The same code is executed whether it’s via ajax or not, but it only captures the parameters when the call is not asynchronous. It seems to me the point of failure should be when the form is rendered using ajax and was injected into the page, because in a sense, it’s not really there so it should fail on both attempts (post-back submit and ajax submit). I know it’s getting to the method because I rendered text to make sure. I’ll fix it eventually, and the problem will probably turn out to be ridiculous, but I think I need to leave it alone for now.

Comments

Do you have something to say about this post?
Retype the image to the right Spam Hint: Are You Human? Textile Formatting Tips

or

Ryan Heath | Site Management A Ruby on Rails production.

This site is a Formed Function. Formed Function LLC | @formedfunction | Get in Touch