I'm very new to the prototype world so I'm sure this is a very newbie
question. I have a page that queries a db and returns rows of
records. Each record has a link to edit the record, which fires an
Ajax.Updater call to pull in a form with the clicked records data for
editing. This part works wonders.
However, the form is nested inside another form and I use <input
type="button onclick="document.forms['myForm'].submit()"> to submit
this form. This works if the page is static, but when pulled in by
Ajax.Updater it throws an error: document.forms.myForm has no
properties. I've also tried to use: onclick="$('myForm').request();"
but returns $("myForm") has no properties.
Now, I have tried also to design the page as such:
<form id="myForm" name="myForm" action="somescript.cgi" method="post">
<div container="formContainer"></div>
<input type="button" value="Save Resource Bundle"
onClick="document.forms['myForm'].submit();"/>
</form>
and formContainer is updated with:
<input type="text" name="mytextfield1"><br />
<input type="text" name="mytextfield2"><br />
<input type="text" name="mytextfield3"><br />
I'm pretty sure I'm doing something fundamentally wrong, is it taboo
to nest forms? Is that my nemesis?
Thanks in advance for any advice.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---