parameter for misc things on submit

marklandry 23 Aug, 2012
Hi,
It's be great if in the submit button params there was a field for calling javascript functions, etc., as opposed to inputting manually via switching the form's code to "custom."

Thanx!

mark
GreyHead 24 Aug, 2012
Hi Mark,

It's broadly considered bad practice to put JavaScript into the input element. Use the Load JS action and the MooTools addEvent() method instead. That neatly keeps all your script in one location and is much easier to write and manage. You do need to add id's to your inputs to keep it simple though.
window.addEvent('domready', function() {
  // add code that needs the dom loaded inside this function
  $('input_id').addEvent('click', function(){
    // some script here
  });
  // add more here
});

Bob
This topic is locked and no more replies can be posted.