Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

global find & replace for all text input fields?


jlknauff

Recommended Posts

Posted

What would be a global find & replace for all text input fields? I only found one that fixed the search box & the tell a friend box. I need to add class="inputb" to all text input boxes. If I just apply the class to all input fields, it also puts a border around buttons.

Posted

includes/functions/html_output.php:

 

////
// Output a form input field
 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;
 }

 

change it to something like:

 

////
// Output a form input field
 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;

  if( $type == 'text' ) $field .= ' class="inputb"';

$field .= '>';

return $field;
 }

Contributions

 

Discount Coupon Codes

Donations

Posted

Perfect. I was able to use that logic to modify most of the fields, the only ones I haven't been able to change are the drop downs and the radio buttons. Any tips for that?

Archived

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

×
×
  • Create New...