Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Removing datepicker in DOB field and remove validation of field


apmuskel

Recommended Posts

Running a 2.3.4 shop and need to remove the datepicker from the DOB field in the sign up form

I am talking about this thing when you select the DOB field:

post-330087-0-52985100-1431006475_thumb.jpg

 

I also need to remove the validation of that field so customer can write anything into it.

Well.. they are going to input a 10 digit number but I guess removing the validation is the easiest way to go?

 

I am also using a PWA form(account_pwa.php), but I am guessing I will manage to do the same edits there if I get help with the "create_account.php" form

 

Thanks alot!

Link to comment
Share on other sites

@@apmuskel

 

If I may ask, what exactly are you trying to do?

 

Are you using the Date of Birth field for another purpose? Or, are you really asking the customer for their birth date?

 

If you are really asking for a birth date, why do you want to remove any date validation? Otherwise, the customer could potentially enter a date of 99/99/9999. Or maybe 00/00/0000 ...

 

Malcolm

Link to comment
Share on other sites

I don't think what you want to do will work without changes to the database. That birth field will want MM/DD/YYYY formatting and just not numbers.

Link to comment
Share on other sites

Instead of using the dob (date of birth) field why not deactivate it in the admin area (configuration -> customer details) and then just create a new field.

You could take the telephone number field as example, look how that is build and just copy it.

That would mean to add a new field into the database customers table. Maybe a VARCHAR 32 should be enough.

The downside would be, you will have to amend many files also in the admin area to be able to show/call that new field inside the customer information area.

Also inside the account_edit.php and few other files. Not impossible though...

Link to comment
Share on other sites

@@apmuskel

 

If I may ask, what exactly are you trying to do?

 

Are you using the Date of Birth field for another purpose? Or, are you really asking the customer for their birth date?

 

If you are really asking for a birth date, why do you want to remove any date validation? Otherwise, the customer could potentially enter a date of 99/99/9999. Or maybe 00/00/0000 ...

 

Malcolm

@Artcolnc

 

I want the user to enter the swedish equivalent to date of birth. That is YYMMDD-XXXX. The "X" is unique personal numbers.

I do realize users can put anything if there is no validation.. but if you really dont whant to input correct information you could just make something up anyways like 12/12/2000 so the validation is more suited for misstypes than getting deliberate misinformation.

 

 

Instead of using the dob (date of birth) field why not deactivate it in the admin area (configuration -> customer details) and then just create a new field.

You could take the telephone number field as example, look how that is build and just copy it.

That would mean to add a new field into the database customers table. Maybe a VARCHAR 32 should be enough.

The downside would be, you will have to amend many files also in the admin area to be able to show/call that new field inside the customer information area.

Also inside the account_edit.php and few other files. Not impossible though...

 

That might be something to look into. Thanks!

I will give it a go and see if I can pull it off

Link to comment
Share on other sites

Why cant I edit my posts?

 

Have a question regarding installation of this addon.

 

It says

Find around L 93:

      $messageStack->add('account_edit', $string_error);
     }
   }
   
   
**** ADD BELOW IT:****

// EOF Customers extra fields

    if ($error == false) {
      $sql_data_array = array('customers_firstname' => $firstname,
                              'customers_lastname' => $lastname,
                              'customers_email_address' => $email_address,
                              'customers_telephone' => $telephone,
                              'customers_fax' => $fax);

      if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender;
      if (ACCOUNT_DOB == 'true') $sql_data_array['customers_dob'] = tep_date_raw($dob);

      tep_db_perform(TABLE_CUSTOMERS, $sql_data_array, 'update', "customers_id = '" . (int)$customer_id . "'");

      tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set customers_info_date_account_last_modified = now() where customers_info_id = '" . (int)$customer_id . "'");

      $sql_data_array = array('entry_firstname' => $firstname,
                              'entry_lastname' => $lastname);

      tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array, 'update', "customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$customer_default_address_id . "'");
// BOF Customers extra fields

 

in my "account_edit.php" it looks like this:

 

$messageStack->add('account_edit', ENTRY_TELEPHONE_NUMBER_ERROR);
    }

    if ($error == false) {
      $sql_data_array = array('customers_firstname' => $firstname,
                              'customers_lastname' => $lastname,
                              'customers_email_address' => $email_address,
                              'customers_telephone' => $telephone,
                              'customers_fax' => $fax);

      if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender;
      if (ACCOUNT_DOB == 'true') $sql_data_array['customers_dob'] = tep_date_raw($dob);

      tep_db_perform(TABLE_CUSTOMERS, $sql_data_array, 'update', "customers_id = '" . (int)$customer_id . "'");

      tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set customers_info_date_account_last_modified = now() where customers_info_id = '" . (int)$customer_id . "'");

      $sql_data_array = array('entry_firstname' => $firstname,
                              'entry_lastname' => $lastname);

      tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array, 'update', "customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$customer_default_address_id . "'");

// reset the session variables
      $customer_first_name = $firstname;

      $messageStack->add_session('account', SUCCESS_ACCOUNT_UPDATED, 'success');

      tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
    }

 

 

It looks like most of the code I am suppost to add is allready in there

And it say I should add after 2 "}" from "$messageStack->add('account_edit', $string_error);"

 

So sould I replace the existing code with the add code or add the new code after the closing "}" after "tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));"

 

Hope someone can help me with this

Link to comment
Share on other sites

hmmm.. when looking closer I cant see any diffrence in the add code and what was allready in my account_edit.php

 

I guess I allready had this in there.. dont know why thou

So I will just skipp this part

 

Sorry for all post, I am not allowed to edit :P

Link to comment
Share on other sites

Ok, last post in this thread.

 

Addon http://addons.oscommerce.com/info/8549

Works great for adding new input fields in create_account.php

 

I am using OSC 2.3.4

 

Had to do some modifications in general.php for the new fields to look the same as the existing onces.

No trouble adding this to my PWA addon for checkout without account

 

The addon allows you to add several new inputs to the form

Textbox, radio, textfield, checkbox ..and so on with or without requirement

 

I can see many uses of this addon(more adress lines for example)

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...