I guess it would be best to prepare a fiddle on http://jsfiddle.net

On 12/09/10 12:12, websam wrote:
> 
> 
> On 9 Dec., 12:54, Piotr Zalewa <[email protected]> wrote:
>> On 12/09/10 11:47, websam wrote:
>>
>>> Hi there,
>>
>>> I have made a class that handles load and submit of a html form. See
>>> code below
>>
>> You may either check if onSubmit is set and not set it the second time
>> or store some setting in the form element and check it on load:
>>
>>      loadForm: function () {
>>          var req = new Request.HTML({
>>              url: this.options.url,
>>              method: 'get',
>>              onSuccess: function (html) {
>>                  $(this.options.injectTo).empty();
>>                  $(this.options.injectTo).adopt(html);
>>                  var formEl = $(this.options.injectTo)
>>                               .getFirst('form');
>>                  if (!formEl.retrieve('loaded')) {
>>                      formEl.addEvent('submit', function (e) {
>>                          e.stop();
>>                          this.submitForm(formId);
>>                      } .bind(this));
>>                      formEl.store('loaded', true);
>>                  }
>>              } .bind(this)
>>          }).send();
>>      },
>>
>> zalun
> 
> I still get the same result :o(
> 
> Mayby i have not explained it good enough. I load a html form through
> an AJAX call
> and when the form is loaded I add the submit event. So when submitting
> the form
> multiple times the form is not getting loaded again, so i never get to
> the code you
> provided until i load the form again.
> 
> The issue is on the submit process, not on form load.
> 
> Does that make sence


-- 
blog  http://piotr.zalewa.info
jobs  http://webdev.zalewa.info
twit  http://twitter.com/zalun
face  http://facebook.com/zaloon

Reply via email to