Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Remove the red * from required fields


NickOnTheNet

Recommended Posts

Posted

Hi Forum,

 

It's my first post and I would first like to say a big thanks to all the developers/programmers that have contributed to a great package!!

 

My question:

 

I need to remove the red * from behind a number of input boxes in the various input fields for the address book (new entry, edit entry etc.), where would I find the code that is responsible?

 

Regards....... Nick

Posted

to remove the "required fields" required to modify the address_book_process.php file and remove the following code:

if (ACCOUNT_GENDER == 'true') {
  if ( ($gender != 'm') && ($gender != 'f') ) {
	$error = true;

	$messageStack->add('addressbook', ENTRY_GENDER_ERROR);
  }
}

if (strlen($firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
  $error = true;

  $messageStack->add('addressbook', ENTRY_FIRST_NAME_ERROR);
}

if (strlen($lastname) < ENTRY_LAST_NAME_MIN_LENGTH) {
  $error = true;

  $messageStack->add('addressbook', ENTRY_LAST_NAME_ERROR);
}

if (strlen($street_address) < ENTRY_STREET_ADDRESS_MIN_LENGTH) {
  $error = true;

  $messageStack->add('addressbook', ENTRY_STREET_ADDRESS_ERROR);
}

if (strlen($postcode) < ENTRY_POSTCODE_MIN_LENGTH) {
  $error = true;

  $messageStack->add('addressbook', ENTRY_POST_CODE_ERROR);
}

if (strlen($city) < ENTRY_CITY_MIN_LENGTH) {
  $error = true;

  $messageStack->add('addressbook', ENTRY_CITY_ERROR);
}

if (!is_numeric($country)) {
  $error = true;

  $messageStack->add('addressbook', ENTRY_COUNTRY_ERROR);
}

if (ACCOUNT_STATE == 'true') {
  $zone_id = 0;
  $check_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "'");
  $check = tep_db_fetch_array($check_query);
  $entry_state_has_zones = ($check['total'] > 0);
  if ($entry_state_has_zones == true) {
	$zone_query = tep_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and (zone_name = '" . tep_db_input($state) . "' or zone_code = '" . tep_db_input($state) . "')");
	if (tep_db_num_rows($zone_query) == 1) {
	  $zone = tep_db_fetch_array($zone_query);
	  $zone_id = $zone['zone_id'];
	} else {
	  $error = true;

	  $messageStack->add('addressbook', ENTRY_STATE_ERROR_SELECT);
	}
  } else {
	if (strlen($state) < ENTRY_STATE_MIN_LENGTH) {
	  $error = true;

	  $messageStack->add('addressbook', ENTRY_STATE_ERROR);
	}
  }
}

this way you remove all validation of address

Please read this line: Do you want to find all the answers to your questions? click here. As for contribution database it's located here!

8 people out of 10 don't bother to read installation manuals. I can recommend: if you can't read the installation manual, don't bother to install any contribution yourself.

Before installing contribution or editing/updating/deleting any files, do the full backup, it will save to you & everyone here on the forum time to fix your issues.

Any issues with oscommerce, I am here to help you.

Posted

What Alex gave you will remove the validation checks -- is that what you wanted, or do you just want to remove the annoying red prompt? Please clarify what you're looking for. What is the purpose of removing this? It's more likely that people will omit necessary information and cause the order process to fail. Are you looking to remove the 'required' on just a few fields (both the code that checks, and the * reminder)?

Archived

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

×
×
  • Create New...