virtualadz Posted June 9, 2006 Share Posted June 9, 2006 hi, all well before making my site live, there are possibly one or two more changes left (and the last one being the task of organizing each file). this is one of them:i have the wholesale enquiry page in my site, can be seen at: www.bhuratea.com/wholesale_inquiry.php , the first thing i did like to do is making the inquiry box smaller in size, i tried but figured out no way, the second being adding some new fields and making them required., the code for my page is: there isn't any js file linked to it, so most probably eveyrhting ought to be done in php. the code which i see to make the text area box smaller is marked down the line in bold. changing values only let's it height to be decreased, width remaisn full.the values of the enquiry box are 50, 15 i treid changing but in vain, any ideas to change it's size<?php/* $Id: wholesale_inquiry.php,v 1.42 2003/06/12 12:17:07 hpdl Exp $*/ require('includes/application_top.php'); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_WHOLESALE); $error = false; if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send')) { $name = tep_db_prepare_input($HTTP_POST_VARS['name']); $email_address = tep_db_prepare_input($HTTP_POST_VARS['email']); $enquiry = tep_db_prepare_input($HTTP_POST_VARS['enquiry']); if (tep_validate_email($email_address)) { // BEGIN CUSTOMER SUBJECT// tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $name, $email_address); tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $HTTP_POST_VARS['email_subject'], $enquiry, $name, $email_address);// END CUSTOMER SUBJECT tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success')); } else { $error = true; $messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR); } } $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_WHOLESALE));?><!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"><html <?php echo HTML_PARAMS; ?>><head><?php// BOF: Header Tag Controller v2.5.7if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) { require(DIR_WS_INCLUDES . 'header_tags.php');} else {?> <title><?php echo TITLE; ?></title><?php}// EOF: Header Tag Controller v2.5.7?><base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"><link rel="stylesheet" type="text/css" href="stylesheet.css"><link rel="stylesheet" media="all" type="text/css" href="basic_dd.css" /><!--[if lte IE 6]><link rel="stylesheet" media="all" type="text/css" href="basic_dd_ie.css" /><![endif]--></head><body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"><!-- header //--><?php require(DIR_WS_INCLUDES . 'header.php'); ?><!-- header_eof //--><!-- body //--><table border="0" width="100%" cellspacing="3" cellpadding="3"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"><!-- left_navigation //--><?php require(DIR_WS_INCLUDES . 'column_left.php'); ?><!-- left_navigation_eof //--> </table></td><!-- body_text //--> <td width="100%" valign="top"><?php echo tep_draw_form('contact_us', tep_href_link(FILENAME_CONTACT_US, 'action=send')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php echo HEADING_TITLE; ?></td> <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_contact_us.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr><?php if ($messageStack->size('contact') > 0) {?> <tr> <td><?php echo $messageStack->output('contact'); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr><?php } if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'success')) {?> <tr> <td class="main" align="center"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_man_on_board.gif', HEADING_TITLE, '0', '0', 'align="left"') . TEXT_SUCCESS; ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr><?php } else {?> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="main"><?php echo ENTRY_NAME; ?></td> </tr> <tr> <td class="main"><?php echo tep_draw_input_field('name'); ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_EMAIL; ?></td> </tr> <tr> <td class="main"><?php echo tep_draw_input_field('email'); ?></td> </tr> <!-- BEGIN CUSTOMER SUBJECT --> <tr> <td class='main'><?php echo ENTRY_CUSTOMER_SUBJECT . '<br>' . tep_draw_input_field('email_subject'); ?></td> </tr><!-- END CUSTOMER SUBJECT --> <tr> <td class="main"><?php echo ENTRY_ENQUIRY; ?></td> </tr> <tr> <td><?php echo tep_draw_textarea_field('enquiry', 'soft', 50, 15, tep_sanitize_string($_POST['enquiry']), '', false); ?></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td align="right"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr><?php }?> </table></form></td><!-- body_text_eof //--> </tr></table><!-- body_eof //--><!-- footer //--><?php require(DIR_WS_INCLUDES . 'footer.php'); ?><!-- footer_eof //--><br></body></html><?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> Link to comment Share on other sites More sharing options...
skym Posted June 9, 2006 Share Posted June 9, 2006 What if you delete the width: 100%; for TEXTAREA in the stylesheet.css file? Link to comment Share on other sites More sharing options...
virtualadz Posted June 16, 2006 Author Share Posted June 16, 2006 no , i dont want to change the width from css, text-area appears many times on my site, so would not like to change it rather add a new class to this<?php echo tep_draw_textarea_field('enquiry', 'soft', 50, 15, tep_sanitize_string($_POST['enquiry']), '', false); ?>where should i add a class to itclass="textarea2">like this<?php echo tep_draw_textarea_field('enquiry', 'soft', 50, 15, tep_sanitize_string($_POST['enquiry']), '', false, 'class="textarea2"'>); ?>i think class should be set like this, what do you think?? Link to comment Share on other sites More sharing options...
Little Goat Posted June 16, 2006 Share Posted June 16, 2006 where did all this code you're making textareas with come from? Link to comment Share on other sites More sharing options...
virtualadz Posted June 16, 2006 Author Share Posted June 16, 2006 no idea?? Link to comment Share on other sites More sharing options...
Little Goat Posted June 16, 2006 Share Posted June 16, 2006 try putting this code in the head of only the page you want the width to be different: <style type="text/css">textarea {width:50%;}</style> Link to comment Share on other sites More sharing options...
virtualadz Posted June 16, 2006 Author Share Posted June 16, 2006 thanks Link to comment Share on other sites More sharing options...
virtualadz Posted June 20, 2006 Author Share Posted June 20, 2006 this is a response to a question asked inhttp://w3schools.invisionzone.com/index.php?showtopic=4718 ////// Output a form function tep_draw_form($name, $action, $method = 'post', $parameters = '') { $form = '<form name="' . tep_output_string($name) . '" action="' . tep_output_string($action) . '" method="' . tep_output_string($method) . '"'; if (tep_not_null($parameters)) $form .= ' ' . $parameters; $form .= '>'; return $form; }////// 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; Link to comment Share on other sites More sharing options...
skym Posted June 20, 2006 Share Posted June 20, 2006 Try with:<?php echo tep_draw_form('contact_us', tep_href_link(FILENAME_WHOLESALE, 'action=send'),'post','id="myForm"'); ?> Link to comment Share on other sites More sharing options...
virtualadz Posted June 20, 2006 Author Share Posted June 20, 2006 <?php echo tep_draw_form('contact_us', tep_href_link(FILENAME_WHOLESALE, 'action=send'),'post','id="myForm"'); ?>the method=post, is printed without adding:html output version <form name="contact_us" action="http://bhuratea.com/wholesale_inquiry.php?action=send" method="post"><table border="0" width="100%" cellspacing="0" cellpadding="0"> php verison: <?php echo tep_draw_form('contact_us', tep_href_link(FILENAME_WHOLESALE, 'action=send')); ?> Link to comment Share on other sites More sharing options...
skym Posted June 20, 2006 Share Posted June 20, 2006 Right. If there are no other arguments for the function then you don't have to mention 'post'.function tep_draw_form($name, $action, $method = 'post', $parameters = '') {...}You didn't have to mention 'post' until now because the default value is already set to 'post'. For $paramenters too. If you want to set your own value for $parameters ('id="myForm"' in this case), you can't jump the $method argument, you have to set a value for that too. Link to comment Share on other sites More sharing options...
virtualadz Posted June 20, 2006 Author Share Posted June 20, 2006 ok, now how to make the reset button a image instead of button.<?php echo tep_image_submit('button_reset.gif', IMAGE_BUTTON_CONTINUE); ?></td> Link to comment Share on other sites More sharing options...
skym Posted June 20, 2006 Share Posted June 20, 2006 <?php echo tep_image_submit('button_reset.gif', IMAGE_BUTTON_CONTINUE); ?>This is for making a submit button? Because of the 'tep_image_submit' function name.We'll very probably need the source for this function too anyway, just like for the previous problem. Link to comment Share on other sites More sharing options...
virtualadz Posted June 20, 2006 Author Share Posted June 20, 2006 give me a minute Link to comment Share on other sites More sharing options...
virtualadz Posted June 20, 2006 Author Share Posted June 20, 2006 ok this is it // The HTML image wrapper function function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '') { if ( (empty($src) || ($src == DIR_WS_IMAGES)) && (IMAGE_REQUIRED == 'false') ) { return false; }// alt is added to the img tag even if it is null to prevent browsers from outputting// the image filename as default $image = '<img src="' . tep_output_string($src) . '" border="0" alt="' . tep_output_string($alt) . '"'; if (tep_not_null($alt)) { $image .= ' title=" ' . tep_output_string($alt) . ' "'; } if ( (CONFIG_CALCULATE_IMAGE_SIZE == 'true') && (empty($width) || empty($height)) ) { if ($image_size = @getimagesize($src)) { if (empty($width) && tep_not_null($height)) { $ratio = $height / $image_size[1]; $width = $image_size[0] * $ratio; } elseif (tep_not_null($width) && empty($height)) { $ratio = $width / $image_size[0]; $height = $image_size[1] * $ratio; } elseif (empty($width) && empty($height)) { $width = $image_size[0]; $height = $image_size[1]; } } elseif (IMAGE_REQUIRED == 'false') { return false; } } if (tep_not_null($width) && tep_not_null($height)) { $image .= ' width="' . tep_output_string($width) . '" height="' . tep_output_string($height) . '"'; } if (tep_not_null($parameters)) $image .= ' ' . $parameters; $image .= '>'; return $image; }////// The HTML form submit button wrapper function// Outputs a button in the selected language function tep_image_submit($image, $alt = '', $parameters = '') { global $language; $image_submit = '<input type="image" src="' . tep_output_string(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image) . '" style="border-width:0px;border-collapse:collapse;" alt="' . tep_output_string($alt) . '"'; if (tep_not_null($alt)) $image_submit .= ' title=" ' . tep_output_string($alt) . ' "'; if (tep_not_null($parameters)) $image_submit .= ' ' . $parameters; $image_submit .= '>'; return $image_submit; }////// Output a function button in the selected language function tep_image_button($image, $alt = '', $parameters = '') { global $language; return tep_image(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image, $alt, '', '', $parameters); }////// Output a separator either through whitespace, or with an image function tep_draw_separator($image = 'pixel_black.gif', $width = '100%', $height = '1') { return tep_image(DIR_WS_IMAGES . $image, '', $width, $height); }////// Output a form function tep_draw_form($name, $action, $method = 'post', $parameters = '') { $form = '<form name="' . tep_output_string($name) . '" action="' . tep_output_string($action) . '" method="' . tep_output_string($method) . '"'; if (tep_not_null($parameters)) $form .= ' ' . $parameters; $form .= '>'; return $form; } Link to comment Share on other sites More sharing options...
skym Posted June 20, 2006 Share Posted June 20, 2006 Try:<?php echo tep_image_submit('button_reset.gif', IMAGE_BUTTON_CONTINUE,'onClick="this.reset();"'); ?> Link to comment Share on other sites More sharing options...
virtualadz Posted June 20, 2006 Author Share Posted June 20, 2006 this buttons now acts as the submit one i.e. sends me an email. i think this is bcoz of the tep_image_submit functionlet me try with this<?php echo tep_image(DIR_WS_IMAGES . 'button_reset', 'Reset', '75', '25', 'onClick="this.reset();"'); ?> Link to comment Share on other sites More sharing options...
virtualadz Posted June 20, 2006 Author Share Posted June 20, 2006 tried as this , it does no good<?php echo tep_image(DIR_WS_IMAGES . 'button_reset.gif', 'onClick="this.reset();"'); ?> Link to comment Share on other sites More sharing options...
virtualadz Posted June 20, 2006 Author Share Posted June 20, 2006 hi there,i am searching for the image function, will come to that later. for now i want to add a undo reset button, is there a way to do this, so that if the visitor by mistake presses the reset can undo it too. >??> Link to comment Share on other sites More sharing options...
justsomeguy Posted June 20, 2006 Share Posted June 20, 2006 No, there's no undo button. You can create your own reset button to save all of the information before it clears it and undo if they hit another button, but there's nothing built-in like submit and reset. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now