sidmel Posted December 7, 2004 Posted December 7, 2004 I did a quick search and couldn't find this anywhere. I'm wanting to add a class name to text input boxes, i.e. "First Name" on the create an account page. I see where the input boxes are being created, but I was looking for some advice before adding something that blows up the forms. :blink:
niknakgroup Posted December 8, 2004 Posted December 8, 2004 this is a trial and error thing - so first things first, BACKUP before you start! Go to stylesheet.css in your main catalog folder. create a new style - the easiest way of getting the syntax right is to copy another style, past it back in, change the names and values to what you need. Then go to your main page in catalog folder and change the item you want to show a new style to the new stylename. Repeat until desired effect is acheived. HTH Please note - if I have suggested a contrib above, it doesnt mean it will work! Most of the contribs are not ones I've used, but may be useful for your particular problem.... Have you tried a refined search? Chances are your problem has already been dealt with elsewhere on the forums..... if (stumped == true) { return(square_one($start_over) } else { $random_query = tep_fetch_answer($forum_query) }
sidmel Posted December 8, 2004 Author Posted December 8, 2004 For any other newbies, I've figured it out, and it's obious once you see it. You simply add the class name in the draw function called from catalog/includes/functions/html_ouput.php I changed the following: ////// Output a form textarea field ? function tep_draw_textarea_field($name, $wrap, $width, $height, $text = '', $parameters = '', $reinsert_value = true) { ? ? $field = '<textarea name="' . tep_output_string($name) . '" wrap="' . tep_output_string($wrap) . '" cols="' . tep_output_string($width) . '" rows="' . tep_output_string($height) . '"'; ? ? if (tep_not_null($parameters)) $field .= ' ' . $parameters; ? ? $field .= '>'; ? ? if ( (isset($GLOBALS[$name])) && ($reinsert_value == true) ) { ? ? ? $field .= stripslashes($GLOBALS[$name]); ? ? } elseif (tep_not_null($text)) { ? ? ? $field .= $text; ? ? } ? ? $field .= '</textarea>'; ? ? return $field; ? } //// to: ////// Output a form textarea field function tep_draw_textarea_field($name, $wrap, $width, $height, $text = '', $parameters = '', $reinsert_value = true) { $field = '<textarea class=form_box name="' . tep_output_string($name) . '" wrap="' . tep_output_string($wrap) . '" cols="' . tep_output_string($width) . '" rows="' . tep_output_string($height) . '"'; if (tep_not_null($parameters)) $field .= ' ' . $parameters; $field .= '>'; if ( (isset($GLOBALS[$name])) && ($reinsert_value == true) ) { $field .= stripslashes($GLOBALS[$name]); } elseif (tep_not_null($text)) { $field .= $text; } $field .= '</textarea>'; return $field; } ////
Jack_mcs Posted December 8, 2004 Posted December 8, 2004 Eric - you may want to take a look at the Form Controller contribution (see my signature). It already does this and more. Jack Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons
Recommended Posts
Archived
This topic is now archived and is closed to further replies.