chrometweaks.org

Whats the best web host or iPage web host?

Click Here To View All Answers...


First of all Whats the best web host or iPage web host? Many thanks for any answer or 2. Another quick question... How can I edit this section of the catalog/create_account.php form to remove the required field for the telephone number and just leave in the form field:.

             <tr>.

               <td class="main"><?php echo ENTRY_TELEPHONE_NUMBER; ?></td>.

               <td class="main"><?php echo tep_draw_input_field('telephone')'&nbsp;'(tep_not_null(ENTRY_TELEPHONE_NUMBER_TEXT) ? '<span class="inputRequirement">'ENTRY_TELEPHONE_NUMBER_TEXT'</span>': ''); ?>.

</td>.

             </tr>.

I want to make the telephone code invalid and keep running into problems. Here is what I've done so far (a lot of work for one thing!):.

1..

I made the telephone field NULL (yes) in SQL.

2..

I changed the define fields in catalog/includes/languages/english.php to this:.

Define('ENTRY_TELEPHONE_NUMBER', 'Telephone Number:');.

Define('ENTRY_TELEPHONE_NUMBER_ERROR', '');.

Define('ENTRY_TELEPHONE_NUMBER_TEXT', '');.

3..

I removed this in catalog/create_account.php:.

   if (strlen($telephone) < ENTRY_TELEPHONE_MIN_LENGTH) {.

     $error = true;.

     $messageStack->add('create_account', ENTRY_TELEPHONE_NUMBER_ERROR);.

   }.

4..

I made the minimum for the phone field 0 in the Admin panel (if I make a blank space instead of the value zero, then it generates an error in Internet Explorer 6)..

Now I'm generating this error:.

Errors have occurred during the process of your form. Please make the following corrections *..

Comments (68)

Hmm... I need to find out myself. I don't know what is the answer. I'll do some poking around and get back to you if I got an answer. You should email the people at iPage as they probably can answer it..

Comment #1

Hi Steve,.

I found that changing the minimum to 0 prompted a javascript that still insisted on a phone entry..

The way that I had to get rid of errors and prompts was to delete the phone number from the minimum requirement in the Admin panel and to delete all instances of the requirement for the field in each .php page. I did a search and found the related pages..

Here is what I did and it seems to work:..

Comment #2

Steve - FYI -.

There is no occurrence of telephone or TELEPHONE in this file:.

Includes/modules/address_book_details.php..

Comment #3

Look in includes/form_check.js.php:.

Check_input("telephone", <?php echo ENTRY_TELEPHONE_MIN_LENGTH; ?>, "<?php echo ENTRY_TELEPHONE_NUMBER_ERROR; ?>");.

This post has been edited by.

Yesudo.

: 25 April 2004, 17:15..

Comment #4

For anyone still getting the javascript error (...must contain a minimum of 0 characters),.

Yesudo.

Was on the right track, but I fixed the javascript instead of going around it..

Find this javascript function in includes/form_check.js.php.

Function check_input(field_name, field_size, message) {.

If (form.elements[field_name] && (form.elements[field_name].type != "hidden")) {.

Var field_value = form.elements[field_name].value;.

If (field_value == '' || field_value.length < field_size) {.

Error_message = error_message + "* " + message + "\n";.

Error = true;.

}.

}.

}.

On the second line, add: && (field_size > 0).

So the function will look like this:.

Function check_input(field_name, field_size, message) {.

If (form.elements[field_name] && (form.elements[field_name].type != "hidden") && (field_size > 0)) {.

Var field_value = form.elements[field_name].value;.

If (field_value == '' || field_value.length < field_size) {.

Error_message = error_message + "* " + message + "\n";.

Error = true;.

}.

}.

}.

Now the function checks first to see if the required size is 0, and skips it if true..

I hope that helps someone..

This post has been edited by.

Nesincg.

: 07 July 2004, 14:06..

Comment #5

That's great! I noticed though that if I edit a customer's profile in the admin section, that I am then required to add a phone number with a minimum value of 0. Is there a corresponding file in the admin section I should alter as well?.

Thanks in advance!..

Comment #6

How can I edit this section of the catalog/create_account.php form to remove the required field for the telephone number and just leave in the form field:.

             <tr>.

               <td class="main"><?php echo ENTRY_TELEPHONE_NUMBER; ?></td>.

               <td class="main"><?php echo tep_draw_input_field('telephone')'&nbsp;'(tep_not_null(ENTRY_TELEPHONE_NUMBER_TEXT) ? '<span class="inputRequirement">'ENTRY_TELEPHONE_NUMBER_TEXT'</span>': ''); ?>.

</td>.

             </tr>.

I want to make the telephone code invalid and keep running into problems. Here is what I've done so far (a lot of work for one thing!):.

1..

I made the telephone field NULL (yes) in SQL.

2..

I changed the define fields in catalog/includes/languages/english.php to this:.

Define('ENTRY_TELEPHONE_NUMBER', 'Telephone Number:');.

Define('ENTRY_TELEPHONE_NUMBER_ERROR', '');.

Define('ENTRY_TELEPHONE_NUMBER_TEXT', '');.

3..

I removed this in catalog/create_account.php:.

   if (strlen($telephone) < ENTRY_TELEPHONE_MIN_LENGTH) {.

     $error = true;.

     $messageStack->add('create_account', ENTRY_TELEPHONE_NUMBER_ERROR);.

   }.

4..

I made the minimum for the phone field 0 in the Admin panel (if I make a blank space instead of the value zero, then it generates an error in Internet Explorer 6)..

Now I'm generating this error:.

Errors have occurred during the process of your form. Please make the following corrections *..

Comment #7

I'm not exactly sure what you're looking for. Do you simply want to make it as if the telephone is never asked for? Here's the simplest way I know of to do that..

Replace the code you posted that outputs the phone prompt with this:.

<?php echo tep_draw_hidden_field('telephone', ''); ?>.

And set the minimum length to 0 in admin. Leave the rest alone. Remember to do this in includes/modules/address_book_details.php too...

Comment #8


This question was taken from a support group/message board and re-posted here so others can learn from it.