Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Automatically changing textfields to upper case


gazb

Recommended Posts

I 'm getting quite a few people entering everything in lower case when the enter their billing or shipping address. How can I change the following code so that it automatically changes to uppercase when they enter a Zip or Post Code?

 

<tr>
           <td class="main"> <?php echo ENTRY_POST_CODE; ?></td>
           <td class="main"> 
<?php
 if ($is_read_only) {
   echo $account['entry_postcode'];
 } elseif ($error) {
   if ($entry_post_code_error) {
     echo tep_draw_input_field('postcode') . ' ' . ENTRY_POST_CODE_ERROR;
   } else {
     echo $postcode . tep_draw_hidden_field('postcode');
   }
 } else {
   echo tep_draw_input_field('postcode', $account['entry_postcode']) . ' ' . ENTRY_POST_CODE_TEXT;
 }
?></td>
         </tr>

Link to comment
Share on other sites

Excellent, thank you. It didn't work on that bit of code for some reason, but it pointed me in the right direction.

 

If anyone else needs to make post codes all upper case:

 

Open create_account.php and find:

 

'entry_postcode' => $postcode,

 

Change to: 'entry_postcode' => strtoupper($postcode),

 

Repeat for: checkout_shipping_address.php and checkout_payment_address.php

Link to comment
Share on other sites

  • 7 years later...

Don't forget to update address_book_process.php, too. So this solution works also if someone is updating his account.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...