Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

clear text fields after form check


conte

Recommended Posts

Posted

hi there, i am looking for this since hours, but could not find anything in the forums.

Can anybody help with that, please?

 

I want the textfields empty that produce an error on the form check of e.g. create account, edit account,...

 

In the moment, the customer will get an error message, that something is wrong, but the text will still be in the field that produced the error and make it more difficult for the customer to identify the field that triggered the error.

 

How can i clear these fields after the form check?

 

thanks a lot

Posted

Hello?? Is there really nobody who can help on this? I can not find any answer to that in the forums - some guru must know how to do this. Please!

Posted

use the unset php function when the form is processed so for example lets say the first name has an incorrect number of characters.

 

	if (strlen($firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
  $error = true;
  unset($firstname);
  $messageStack->add('create_account', ENTRY_FIRST_NAME_ERROR);
}

  • 2 weeks later...
Posted
use the unset php function when the form is processed so for example lets say the first name has an incorrect number of characters.

 

	if (strlen($firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
  $error = true;
  unset($firstname);
  $messageStack->add('create_account', ENTRY_FIRST_NAME_ERROR);
}

 

 

thanks for the help - unfortunatly that did not help. no error, but also no different behavior.

Posted
thanks for the help - unfortunatly that did not help. no error, but also no different behavior.

I gather you do not even get that far, but use the js form validation? That is the spot where the fileds need to be clearend then.

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Archived

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

×
×
  • Create New...