I am using JS to replace my submit buttons with A tags w/ observers.
The reason for this is I want better looking buttons. When the A is
clicked it does some validation, and then "clicks" the hidden submit
button.

When JS "clicks" the button however they name/value is not getting
submitted along with the other form values in the _POST such as if a
person clicked a regular submit button.  Do you know how to get this
to happen?

As an FYI, here is the code I am using:


$(form).select('INPUT[type="submit"]').each(function(b) {

        new_id                  = 'submit_btn_'+i;

        // Turning off hide so you can test the difference
        // input_button         = b.hide();
        input_button    = b;
        input_button.insert({after: '<a class="button_dark submit"
id="'+new_id+'" href="#" onClick="this.blur();"><span>'+
input_button.value +'</span></a>'});
        new_button              = $(new_id);

        // Can't use click, because sometimes mouseup/down does not happen on
the same element, there is a span in there too.
        new_button.observe('mouseup', function(e) {
                e.stop();
                // Do some validation
                if (true) input_button.click();
        });

        i++;

});


--~--~---------~--~----~------------~-------~--~----~
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 rubyonrails-spinoffs@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to