Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Adding a Event handler to input field.


WS Evolution

Recommended Posts

How can I add an onChange="myJavaScriptFunction()" event handler to the credit card input field? I guess I will have to pass the event handler to the tep_draw_input_field () function.

 

Here is the code in my payment mod:

 

'field' => tep_draw_input_field('authorizenet_cc_number')),

 

here is the function:

 

  function tep_draw_input_field($name, $value = '', $parameters = '', $type = 'text', $reinsert_value = true) {
$field = '<input type="' . tep_output_string($type) . '" name="' . tep_output_string($name) . '"';

if ( (isset($GLOBALS[$name])) && ($reinsert_value == true) ) {
  $field .= ' value="' . tep_output_string(stripslashes($GLOBALS[$name])) . '"';
} elseif (tep_not_null($value)) {
  $field .= ' value="' . tep_output_string($value) . '"';
}

if (tep_not_null($parameters)) $field .= ' ' . $parameters;

$field .= '>';

return $field;
 }

 

Maybe use $parameters to pass the event handler???

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...