[Skip to main content](#vessel-content)

#   Add specific validation rules for a custom field

##

- **[GEVC](/forum/user/5233-gevc "View GEVC's Profile")**
- [![GEVC's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/5233-gevc "View GEVC's Profile") Topic Author
- [ Offline](/forum/user/5233-gevc)

Less More

- Posts: 8
- Thank you received: 0
-
-

14 years 10 months ago [\#33707](#33707) by [GEVC](/forum/user/5233-gevc "View GEVC's Profile")  *[Add specific validation rules for a custom field](/forum/4-how-to/33707-add-specific-validation-rules-for-a-custom-field#33707 "I would like to add a custom date field on the checkout page. I need to do some custom validation on this date field. Customers should select a date in the future (which is already possible) but some...")* was created by *[GEVC](/forum/user/5233-gevc "View GEVC's Profile")*

I would like to add a custom date field on the checkout page. I need to do some custom validation on this date field. Customers should select a date in the future (which is already possible) but some dates are not allowed. Is it possible to add some specific validation code (even if it means that this code is lost when upgrading hikashop)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzMzNzA3LWFkZC1zcGVjaWZpYy12YWxpZGF0aW9uLXJ1bGVzLWZvci1hLWN1c3RvbS1maWVsZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86289
- Thank you received: 14265
-
-

14 years 10 months ago [\#33733](#33733) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Add specific validation rules for a custom field](/forum/4-how-to/33707-add-specific-validation-rules-for-a-custom-field#33733 "I would like to add a custom date field on the checkout page. I need to do some custom validation on this date field. Customers should select a date in the future (which is already possible) but some...")*

You would have to edit the file administrator/components/classes/field.php and change the function display of the class hikashopDate

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzMzNzA3LWFkZC1zcGVjaWZpYy12YWxpZGF0aW9uLXJ1bGVzLWZvci1hLWN1c3RvbS1maWVsZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[GEVC](/forum/user/5233-gevc "View GEVC's Profile")**
- [![GEVC's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/5233-gevc "View GEVC's Profile") Topic Author
- [ Offline](/forum/user/5233-gevc)

Less More

- Posts: 8
- Thank you received: 0
-
-

14 years 9 months ago [\#33838](#33838) by [GEVC](/forum/user/5233-gevc "View GEVC's Profile")  Replied by *[GEVC](/forum/user/5233-gevc "View GEVC's Profile")* on topic *[Re: Add specific validation rules for a custom field](/forum/4-how-to/33707-add-specific-validation-rules-for-a-custom-field#33838 "I would like to add a custom date field on the checkout page. I need to do some custom validation on this date field. Customers should select a date in the future (which is already possible) but some...")*

Thanks.

Just another remark about the existing validation on 'future' or 'past' dates. When selecting a date from the date control, the validation is done correctly but when a user types a date without using the date control, no validation is done. Is that a (known) bug or am I doing something wrong ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzMzNzA3LWFkZC1zcGVjaWZpYy12YWxpZGF0aW9uLXJ1bGVzLWZvci1hLWN1c3RvbS1maWVsZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86289
- Thank you received: 14265
-
-

14 years 9 months ago [\#33856](#33856) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Add specific validation rules for a custom field](/forum/4-how-to/33707-add-specific-validation-rules-for-a-custom-field#33856 "I would like to add a custom date field on the checkout page. I need to do some custom validation on this date field. Customers should select a date in the future (which is already possible) but some...")*

It's not a known bug. That feature has been added only recently and no one noticed that so far.
Maybe it's because the date entered is not a valid date and thus the Date js function is not able to understand it and the the test is just skipped ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzMzNzA3LWFkZC1zcGVjaWZpYy12YWxpZGF0aW9uLXJ1bGVzLWZvci1hLWN1c3RvbS1maWVsZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[GEVC](/forum/user/5233-gevc "View GEVC's Profile")**
- [![GEVC's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/5233-gevc "View GEVC's Profile") Topic Author
- [ Offline](/forum/user/5233-gevc)

Less More

- Posts: 8
- Thank you received: 0
-
-

14 years 9 months ago [\#33901](#33901) by [GEVC](/forum/user/5233-gevc "View GEVC's Profile")  Replied by *[GEVC](/forum/user/5233-gevc "View GEVC's Profile")* on topic *[Re: Add specific validation rules for a custom field](/forum/4-how-to/33707-add-specific-validation-rules-for-a-custom-field#33901 "I would like to add a custom date field on the checkout page. I need to do some custom validation on this date field. Customers should select a date in the future (which is already possible) but some...")*

I even have the same issue when entering a date manually in the same format as it is displayed when selecting a date from the control. Would it be possible that I disable the textfield so that users should use the control to select a valid date ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzMzNzA3LWFkZC1zcGVjaWZpYy12YWxpZGF0aW9uLXJ1bGVzLWZvci1hLWN1c3RvbS1maWVsZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86289
- Thank you received: 14265
-
-

14 years 9 months ago [\#33910](#33910) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Add specific validation rules for a custom field](/forum/4-how-to/33707-add-specific-validation-rules-for-a-custom-field#33910 "I would like to add a custom date field on the checkout page. I need to do some custom validation on this date field. Customers should select a date in the future (which is already possible) but some...")*

Could you add the line:
$size .= ' onChange="'.$this-&gt;prefix.$field-&gt;field_namekey.$this-&gt;suffix.'_checkDate();"';

after the line:
$field-&gt;field_options.='", onClose : '.$this-&gt;prefix.$field-&gt;field_namekey.$this-&gt;suffix.'_checkDate, //';

in the file administrator/components/classes/field.php and try again ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzMzNzA3LWFkZC1zcGVjaWZpYy12YWxpZGF0aW9uLXJ1bGVzLWZvci1hLWN1c3RvbS1maWVsZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[GEVC](/forum/user/5233-gevc "View GEVC's Profile")**
- [![GEVC's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/5233-gevc "View GEVC's Profile") Topic Author
- [ Offline](/forum/user/5233-gevc)

Less More

- Posts: 8
- Thank you received: 0
-
-

14 years 9 months ago [\#33923](#33923) by [GEVC](/forum/user/5233-gevc "View GEVC's Profile")  Replied by *[GEVC](/forum/user/5233-gevc "View GEVC's Profile")* on topic *[Re: Add specific validation rules for a custom field](/forum/4-how-to/33707-add-specific-validation-rules-for-a-custom-field#33923 "I would like to add a custom date field on the checkout page. I need to do some custom validation on this date field. Customers should select a date in the future (which is already possible) but some...")*

Thanks a lot, the validation on the date field is also executed now when entering a date manually. There is only one issue when people entering dates in an incorrect format (not yyyy-mm-dd). In that case, the validation does not work properly but I can add an additional test in the javascript to check the format with a regular expression.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzMzNzA3LWFkZC1zcGVjaWZpYy12YWxpZGF0aW9uLXJ1bGVzLWZvci1hLWN1c3RvbS1maWVsZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86289
- Thank you received: 14265
-
-

14 years 9 months ago [\#33956](#33956) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Add specific validation rules for a custom field](/forum/4-how-to/33707-add-specific-validation-rules-for-a-custom-field#33956 "I would like to add a custom date field on the checkout page. I need to do some custom validation on this date field. Customers should select a date in the future (which is already possible) but some...")*

Yes, we'll add a check for that on our end too. Thank you for your feedback.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzMzNzA3LWFkZC1zcGVjaWZpYy12YWxpZGF0aW9uLXJ1bGVzLWZvci1hLWN1c3RvbS1maWVsZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[GEVC](/forum/user/5233-gevc "View GEVC's Profile")**
- [![GEVC's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/5233-gevc "View GEVC's Profile") Topic Author
- [ Offline](/forum/user/5233-gevc)

Less More

- Posts: 8
- Thank you received: 0
-
-

14 years 9 months ago [\#33989](#33989) by [GEVC](/forum/user/5233-gevc "View GEVC's Profile")  Replied by *[GEVC](/forum/user/5233-gevc "View GEVC's Profile")* on topic *[Re: Add specific validation rules for a custom field](/forum/4-how-to/33707-add-specific-validation-rules-for-a-custom-field#33989 "I would like to add a custom date field on the checkout page. I need to do some custom validation on this date field. Customers should select a date in the future (which is already possible) but some...")*

In which version will this bugfix be included and when will it be released. I just started with the Hikashop starter edition and have done an evaluation of the functionality. I'm happy with it and I will sell the business edition in the coming days.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzMzNzA3LWFkZC1zcGVjaWZpYy12YWxpZGF0aW9uLXJ1bGVzLWZvci1hLWN1c3RvbS1maWVsZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86289
- Thank you received: 14265
-
-

14 years 9 months ago [\#34034](#34034) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Add specific validation rules for a custom field](/forum/4-how-to/33707-add-specific-validation-rules-for-a-custom-field#34034 "I would like to add a custom date field on the checkout page. I need to do some custom validation on this date field. Customers should select a date in the future (which is already possible) but some...")*

It will be in all versions of course.
It will be released with next version in several weeks.

If you want it now, you can just add the code:
if(!selectedDate){
selObj.value=\'\';
alert(\''.JText::_('INCORRECT_DATE_FORMAT',true).'\');
return false;
}

after the line:
var selectedDate = new Date(selObj.value);

in that same file and it will display an error message when the date doesn't have the correct format.
Also, the line below will have to be added to your translation file:
INCORRECT_DATE_FORMAT="Incorrect date format"

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzMzNzA3LWFkZC1zcGVjaWZpYy12YWxpZGF0aW9uLXJ1bGVzLWZvci1hLWN1c3RvbS1maWVsZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[GEVC](/forum/user/5233-gevc "View GEVC's Profile")**
- [![GEVC's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/5233-gevc "View GEVC's Profile") Topic Author
- [ Offline](/forum/user/5233-gevc)

Less More

- Posts: 8
- Thank you received: 0
-
-

14 years 9 months ago [\#34103](#34103) by [GEVC](/forum/user/5233-gevc "View GEVC's Profile")  Replied by *[GEVC](/forum/user/5233-gevc "View GEVC's Profile")* on topic *[Re: Add specific validation rules for a custom field](/forum/4-how-to/33707-add-specific-validation-rules-for-a-custom-field#34103 "I would like to add a custom date field on the checkout page. I need to do some custom validation on this date field. Customers should select a date in the future (which is already possible) but some...")*

When adding the code for checking the date format, I always get the following error :
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in .../public_html/administrator/components/com_hikashop/classes/field.php on line 1219

For the rest everything works fine in Firefox and Google Chrome but I tested also on Internet Explorer 7. In this browser, the check on future or past dates doesn't work at all. When selecting a date in the control or typing a date manually, an 'Error on page' occurs.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzMzNzA3LWFkZC1zcGVjaWZpYy12YWxpZGF0aW9uLXJ1bGVzLWZvci1hLWN1c3RvbS1maWVsZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86289
- Thank you received: 14265
-
-

14 years 9 months ago [\#34141](#34141) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Add specific validation rules for a custom field](/forum/4-how-to/33707-add-specific-validation-rules-for-a-custom-field#34141 "I would like to add a custom date field on the checkout page. I need to do some custom validation on this date field. Customers should select a date in the future (which is already possible) but some...")*

And what do you have on line 1219 ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzMzNzA3LWFkZC1zcGVjaWZpYy12YWxpZGF0aW9uLXJ1bGVzLWZvci1hLWN1c3RvbS1maWVsZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[GEVC](/forum/user/5233-gevc "View GEVC's Profile")**
- [![GEVC's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/5233-gevc "View GEVC's Profile") Topic Author
- [ Offline](/forum/user/5233-gevc)

Less More

- Posts: 8
- Thank you received: 0
-
-

14 years 9 months ago [\#34154](#34154) by [GEVC](/forum/user/5233-gevc "View GEVC's Profile")  Replied by *[GEVC](/forum/user/5233-gevc "View GEVC's Profile")* on topic *[Re: Add specific validation rules for a custom field](/forum/4-how-to/33707-add-specific-validation-rules-for-a-custom-field#34154 "I would like to add a custom date field on the checkout page. I need to do some custom validation on this date field. Customers should select a date in the future (which is already possible) but some...")*

I tried again and now after my upgrade to the Business edition,I don't have the error anymore. It was probably due to a mistake in the translation file. So, now I don't have the error anymore but, I never get the message 'Incorrect date format', even when I type a date in a format like 15/12/2011. When I try it with the regular expression it works (except in Internet Explorer).

Besides, I also have a question about the checkout process. In my current checkout process, I see the different parts (as defined in the configuration) and everything works fine but at the end of the checkout process, users have to click the 'next' button. After clicking 'next', a page is displayed that tells them that the order was already submitted. I wonder if there is a possibility to add some confirmation page in between so that users really now that they will already submit the order when pressing the 'next' button. Another option would be that I can change the 'Next' button on the bottom of the checkout page into a button with label 'Submit order'. In that case, no intermediate confirmation is necessary.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzMzNzA3LWFkZC1zcGVjaWZpYy12YWxpZGF0aW9uLXJ1bGVzLWZvci1hLWN1c3RvbS1maWVsZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86289
- Thank you received: 14265
-
-

14 years 9 months ago [\#34183](#34183) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Add specific validation rules for a custom field](/forum/4-how-to/33707-add-specific-validation-rules-for-a-custom-field#34183 "I would like to add a custom date field on the checkout page. I need to do some custom validation on this date field. Customers should select a date in the future (which is already possible) but some...")*

If you want it to work for IE you will need to use a specific format of date:
[ stackoverflow.com/questions/3046459/ie-d...ate-with-time-string](http://stackoverflow.com/questions/3046459/ie-date-parse-method-returns-nan-for-date-with-time-string)

Otherwise, it would mean to parse manually the date (really complicated) or use an external JS library like dateJS (easier but still requires work for the library to be integrated into the system).

For the incorrect date, that will require quite some changes. Here is the Display function code which works properly on our end:

function display($field,$value,$map,$inside,$options='',$test=false){
if(empty($field-&gt;field_options)) $field-&gt;field_options = "%Y-%m-%d";
$format = $field-&gt;field_options;
$size = $options . empty($field-&gt;field_options) ? '' : ' size="'.$field-&gt;field_options.'"';
if(!empty($field-&gt;field_options)){
JHTML::_('behavior.mootools');
$processing='';
switch($field-&gt;field_options){
case 'future':
$check = 'today&gt;selectedDate';
$message = JText::_('SELECT_DATE_IN_FUTURE',true);
break;
case 'past':
$check = 'today&lt;selectedDate';
$message = JText::_('SELECT_DATE_IN_PAST',true);
break;
}
$js = 'function '.$this-&gt;prefix.$field-&gt;field_namekey.$this-&gt;suffix.'_checkDate(nohide)
{
var selObj = document.getElementById(\''.$this-&gt;prefix.$field-&gt;field_namekey.$this-&gt;suffix.'\');
if(selObj.value=![=&#92;](/irritated.gif "=&#92;")'\'){
return true;
}
var timestamp=Date.parse(selObj.value);
var today=new Date();
if(isNaN(timestamp)!=false){
selObj.value=\'\';
alert(\''.JText::_('INCORRECT_DATE_FORMAT',true).'\');
return false;
}
var selectedDate = new Date(timestamp);

'.$processing.'
if('.$check.'){
selObj.value=\'\';
alert(\''.$message.'\');
}else{
if(!nohide) this.hide();
}
}';
$document = &amp; JFactory::getDocument();
$document-&gt;addScriptDeclaration($js);
$size .= ' onChange="'.$this-&gt;prefix.$field-&gt;field_namekey.$this-&gt;suffix.'_checkDate(1);"';
}

return JHTML::_('calendar', $value, $map,$this-&gt;prefix.$field-&gt;field_namekey.$this-&gt;suffix,$format,$size);
}

You can add a confirmation step. Just configure your checkout workflow in the Checkout tab of the configuration for that.
You can also change the next button for a specific step: [ www.hikashop.com/en/support/forum/4-how-...bel-next-button.html](http://www.hikashop.com/en/support/forum/4-how-to/9242-label-next-button.html)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzMzNzA3LWFkZC1zcGVjaWZpYy12YWxpZGF0aW9uLXJ1bGVzLWZvci1hLWN1c3RvbS1maWVsZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[GEVC](/forum/user/5233-gevc "View GEVC's Profile")**
- [![GEVC's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/5233-gevc "View GEVC's Profile") Topic Author
- [ Offline](/forum/user/5233-gevc)

Less More

- Posts: 8
- Thank you received: 0
-
-

14 years 9 months ago [\#34331](#34331) by [GEVC](/forum/user/5233-gevc "View GEVC's Profile")  Replied by *[GEVC](/forum/user/5233-gevc "View GEVC's Profile")* on topic *[Re: Add specific validation rules for a custom field](/forum/4-how-to/33707-add-specific-validation-rules-for-a-custom-field#34331 "I would like to add a custom date field on the checkout page. I need to do some custom validation on this date field. Customers should select a date in the future (which is already possible) but some...")*

Thanks for the information.

The code that you have sent works fine in Google Chrome as well as in Firefox but the date control doesn't close anymore after selecting the date. When clicking the x button, nothing happens. It's not blocking as it's still possible to click the next button but it's not optimal and in Internet Explorer, the control doesn't work at all. Here, the user is really blocked because the 'incorrect_date_format' error pops up every time you select a date and the close button doesn't work. Because of this, I'm not sure if this code should be implemented as a global solution in a next release.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzMzNzA3LWFkZC1zcGVjaWZpYy12YWxpZGF0aW9uLXJ1bGVzLWZvci1hLWN1c3RvbS1maWVsZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86289
- Thank you received: 14265
-
-

14 years 9 months ago [\#34366](#34366) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Add specific validation rules for a custom field](/forum/4-how-to/33707-add-specific-validation-rules-for-a-custom-field#34366 "I would like to add a custom date field on the checkout page. I need to do some custom validation on this date field. Customers should select a date in the future (which is already possible) but some...")*

I'm working on Chrome and the close button is working fine on my end. It's working on IE too.

For the incorrect date format on IE, as I said, you would have to use a specific date format if you want it to work: %Y/%m/%d
You can configure it in the format option of your custom field.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzMzNzA3LWFkZC1zcGVjaWZpYy12YWxpZGF0aW9uLXJ1bGVzLWZvci1hLWN1c3RvbS1maWVsZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop- Install &amp; Update- Product &amp; Category Display- Content Creation- Sales and Orders- - Orders management- - Reports &amp; Statistics- Customers- Checkout- Payment Methods- Shipping Methods- Import &amp; Export (CSV, XLS…)- Specific Features- - Affilation- - Taxes- - Wishlist- - Vote- - Carousel &amp; Slider- - Mass Actions- - Filters &amp; Search- - Discount &amp; Coupon- - Feature Request- Integrations- Showcase- General Talk about HikaShop- Development- - HikaShop 3.0 Beta- Translation- Commercial Jobs HikaShop Components- HikaMarket- - Market: Feature requests- - Market: How to?- - Market: Bug Report- HikaSerial- - General talk about HikaSerial- - Serial: Bug Report- - Serial: How to?- - Support en Français de HikaSerial (French Support)- - HikaSubscription- HikaAuction- - Auction: Feature requests- - Auction: How to?- - Auction: Bug report Hikashop around the world- Support en Français (French Support)- Russian- - FAQ. Курс выживания с Hikashop. Частые вопросы и о- - Расширения Hikashop- - Наши сайты на Hikashop- 日本語版サポート(Japanese Support)- Thai- German Archives- Bug Report- How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.460 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
