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

#   Required filed not being enforced upon checkout.

##

- **[solia](/forum/user/10273-solia "View solia's Profile")**
- [![solia's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar10273.jpg)](/forum/user/10273-solia "View solia's Profile") Topic Author
- [ Offline](/forum/user/10273-solia)

Less More

- Posts: 30
- Thank you received: 2
-
-

8 years 11 months ago [\#283176](#283176) by [solia](/forum/user/10273-solia "View solia's Profile")  *[Required filed not being enforced upon checkout.](/forum/27-checkout/892917-required-filed-not-being-enforced-upon-checkout#283176 "-- HikaShop version -- : 3.2.1 -- Joomla version -- : 3.8.2 -- PHP version -- : 7.0.25 -- Browser(s) name and version -- : Firefox 57.0  Greetings.  We are located in the United States.  One of our clients is in Florida. It must therefore remit both state and local taxes.The local taxes are county taxes.  We modified the Hikashop setup by changing the country to be a US state and the State to be a Florida county on our site. Our issue is not with the tax, but with making the State and county fields required without a Default value.  Our configuration in the backend displays State and Local fields are required fields.  At first, people were neglecting to select the proper County since by default the system kept the first alphabetic County as a selection (that created the wrong tax amount for the customer)  So we thought best to have &quot;&#42;&#42;select your state&quot; or &quot;&#42;&#42;select your county if in FL&quot; in the zones under the Country and State. So, we created those entries, and now that is the first thing they see. Doing so created another issue. The required field was being bypassed by having the selection of &quot;&#42;&#42;select your state&quot; or &quot;&#42;&#42;slect your county if in FL.&quot; since they were the default value options.  Now the customer can checkout without proper State or Local values selected and tax applied.  A recent order cought our attention when a customer was able to process their order without selecting the County and therefore the additional local tax was not applied.  In summary: During checkout, if a client selects Florida for an address, a required field of a county must be selected to complete the order apply the porper taxes then process the payment. We have the field set to be required, but that requirment is not being enforced becaus the default value we have is &quot;&#42;&#42;select your county if in FL&quot; that is making the the system recognize the field as filled already.  Thus my succinct question: Any ideas on how to make that field required but without a default value so that it alerts the customer they must select a county when Florida is selected as the state?  Thank you for your help is this matter.")* was created by *[solia](/forum/user/10273-solia "View solia's Profile")*

-- HikaShop version -- : 3.2.1
-- Joomla version -- : 3.8.2
-- PHP version -- : 7.0.25
-- Browser(s) name and version -- : Firefox 57.0

Greetings.

We are located in the United States.

One of our clients is in Florida. It must therefore remit both state and local taxes.The local taxes are county taxes.

We modified the Hikashop setup by changing the country to be a US state and the State to be a Florida county on our site. Our issue is not with the tax, but with making the State and county fields required without a Default value.

Our configuration in the backend displays State and Local fields are required fields.

At first, people were neglecting to select the proper County since by default the system kept the first alphabetic County as a selection (that created the wrong tax amount for the customer)

So we thought best to have "**select your state" or "**select your county if in FL" in the zones under the Country and State. So, we created those entries, and now that is the first thing they see. Doing so created another issue. The required field was being bypassed by having the selection of "**select your state" or "**slect your county if in FL." since they were the default value options.

Now the customer can checkout without proper State or Local values selected and tax applied.

A recent order cought our attention when a customer was able to process their order without selecting the County and therefore the additional local tax was not applied.

In summary: During checkout, if a client selects Florida for an address, a required field of a county must be selected to complete the order apply the porper taxes then process the payment. We have the field set to be required, but that requirment is not being enforced becaus the default value we have is "**select your county if in FL" that is making the the system recognize the field as filled already.

Thus my succinct question: Any ideas on how to make that field required but without a default value so that it alerts the customer they must select a county when Florida is selected as the state?

Thank you for your help is this matter.

- [ ![field.JPG](/forum/attachment/41466) ](/forum/attachment/41466 "field.JPG") [ ](/forum/attachment/41466?download=1 "field.JPG")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg5MjkxNy1yZXF1aXJlZC1maWxlZC1ub3QtYmVpbmctZW5mb3JjZWQtdXBvbi1jaGVja291dD90bXBsPW1hcmtkb3du) 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?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86359
- Thank you received: 14293
-
-

8 years 11 months ago [\#283182](#283182) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Required filed not being enforced upon checkout.](/forum/27-checkout/892917-required-filed-not-being-enforced-upon-checkout#283182 "-- HikaShop version -- : 3.2.1 -- Joomla version -- : 3.8.2 -- PHP version -- : 7.0.25 -- Browser(s) name and version -- : Firefox 57.0  Greetings.  We are located in the United States.  One of our clients is in Florida. It must therefore remit both state and local taxes.The local taxes are county taxes.  We modified the Hikashop setup by changing the country to be a US state and the State to be a Florida county on our site. Our issue is not with the tax, but with making the State and county fields required without a Default value.  Our configuration in the backend displays State and Local fields are required fields.  At first, people were neglecting to select the proper County since by default the system kept the first alphabetic County as a selection (that created the wrong tax amount for the customer)  So we thought best to have &quot;&#42;&#42;select your state&quot; or &quot;&#42;&#42;select your county if in FL&quot; in the zones under the Country and State. So, we created those entries, and now that is the first thing they see. Doing so created another issue. The required field was being bypassed by having the selection of &quot;&#42;&#42;select your state&quot; or &quot;&#42;&#42;slect your county if in FL.&quot; since they were the default value options.  Now the customer can checkout without proper State or Local values selected and tax applied.  A recent order cought our attention when a customer was able to process their order without selecting the County and therefore the additional local tax was not applied.  In summary: During checkout, if a client selects Florida for an address, a required field of a county must be selected to complete the order apply the porper taxes then process the payment. We have the field set to be required, but that requirment is not being enforced becaus the default value we have is &quot;&#42;&#42;select your county if in FL&quot; that is making the the system recognize the field as filled already.  Thus my succinct question: Any ideas on how to make that field required but without a default value so that it alerts the customer they must select a county when Florida is selected as the state?  Thank you for your help is this matter.")*

Hi,

We actually have a specific option in the zone custom fields that you can activate in order to display a "please select" choice which will enforce the "required" requirement of the custom field. That option is called "Add a 'Please select' value".
So just activate it for both of your custom fields and it should work like you want without the need for an extra "please select" zone or anything.

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

- **[solia](/forum/user/10273-solia "View solia's Profile")**
- [![solia's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar10273.jpg)](/forum/user/10273-solia "View solia's Profile") Topic Author
- [ Offline](/forum/user/10273-solia)

Less More

- Posts: 30
- Thank you received: 2
-
-

8 years 11 months ago [\#283239](#283239) by [solia](/forum/user/10273-solia "View solia's Profile")  Replied by *[solia](/forum/user/10273-solia "View solia's Profile")* on topic *[Required filed not being enforced upon checkout.](/forum/27-checkout/892917-required-filed-not-being-enforced-upon-checkout#283239 "-- HikaShop version -- : 3.2.1 -- Joomla version -- : 3.8.2 -- PHP version -- : 7.0.25 -- Browser(s) name and version -- : Firefox 57.0  Greetings.  We are located in the United States.  One of our clients is in Florida. It must therefore remit both state and local taxes.The local taxes are county taxes.  We modified the Hikashop setup by changing the country to be a US state and the State to be a Florida county on our site. Our issue is not with the tax, but with making the State and county fields required without a Default value.  Our configuration in the backend displays State and Local fields are required fields.  At first, people were neglecting to select the proper County since by default the system kept the first alphabetic County as a selection (that created the wrong tax amount for the customer)  So we thought best to have &quot;&#42;&#42;select your state&quot; or &quot;&#42;&#42;select your county if in FL&quot; in the zones under the Country and State. So, we created those entries, and now that is the first thing they see. Doing so created another issue. The required field was being bypassed by having the selection of &quot;&#42;&#42;select your state&quot; or &quot;&#42;&#42;slect your county if in FL.&quot; since they were the default value options.  Now the customer can checkout without proper State or Local values selected and tax applied.  A recent order cought our attention when a customer was able to process their order without selecting the County and therefore the additional local tax was not applied.  In summary: During checkout, if a client selects Florida for an address, a required field of a county must be selected to complete the order apply the porper taxes then process the payment. We have the field set to be required, but that requirment is not being enforced becaus the default value we have is &quot;&#42;&#42;select your county if in FL&quot; that is making the the system recognize the field as filled already.  Thus my succinct question: Any ideas on how to make that field required but without a default value so that it alerts the customer they must select a county when Florida is selected as the state?  Thank you for your help is this matter.")*

Thank you so much Nicolas for your quick reply!

I removed the extra "Please select" that I added previously. I activated "Add a 'Please select' value" in the custom filed per your instructions. The fields now display better on the front end. However, when I chose Florida it still allowed me to proceed with my order without enforcing the required filed for the county to add the taxes.
The state selection is enforced, but the county selection when choosing Florida or Canda is not being enforced.

I would appreciate your further thoughts on this.

The site is [ www.tokeshoes.com](http://www.tokeshoes.com)

With kind regards,

Nadine

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

- **[solia](/forum/user/10273-solia "View solia's Profile")**
- [![solia's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar10273.jpg)](/forum/user/10273-solia "View solia's Profile") Topic Author
- [ Offline](/forum/user/10273-solia)

Less More

- Posts: 30
- Thank you received: 2
-
-

8 years 11 months ago [\#283240](#283240) by [solia](/forum/user/10273-solia "View solia's Profile")  Replied by *[solia](/forum/user/10273-solia "View solia's Profile")* on topic *[Required filed not being enforced upon checkout.](/forum/27-checkout/892917-required-filed-not-being-enforced-upon-checkout#283240 "-- HikaShop version -- : 3.2.1 -- Joomla version -- : 3.8.2 -- PHP version -- : 7.0.25 -- Browser(s) name and version -- : Firefox 57.0  Greetings.  We are located in the United States.  One of our clients is in Florida. It must therefore remit both state and local taxes.The local taxes are county taxes.  We modified the Hikashop setup by changing the country to be a US state and the State to be a Florida county on our site. Our issue is not with the tax, but with making the State and county fields required without a Default value.  Our configuration in the backend displays State and Local fields are required fields.  At first, people were neglecting to select the proper County since by default the system kept the first alphabetic County as a selection (that created the wrong tax amount for the customer)  So we thought best to have &quot;&#42;&#42;select your state&quot; or &quot;&#42;&#42;select your county if in FL&quot; in the zones under the Country and State. So, we created those entries, and now that is the first thing they see. Doing so created another issue. The required field was being bypassed by having the selection of &quot;&#42;&#42;select your state&quot; or &quot;&#42;&#42;slect your county if in FL.&quot; since they were the default value options.  Now the customer can checkout without proper State or Local values selected and tax applied.  A recent order cought our attention when a customer was able to process their order without selecting the County and therefore the additional local tax was not applied.  In summary: During checkout, if a client selects Florida for an address, a required field of a county must be selected to complete the order apply the porper taxes then process the payment. We have the field set to be required, but that requirment is not being enforced becaus the default value we have is &quot;&#42;&#42;select your county if in FL&quot; that is making the the system recognize the field as filled already.  Thus my succinct question: Any ideas on how to make that field required but without a default value so that it alerts the customer they must select a county when Florida is selected as the state?  Thank you for your help is this matter.")*

[ ![required.JPG](/forum/attachment/41479) ](/forum/attachment/41479 "required.JPG")

- [ ![required.JPG](/forum/attachment/41479) ](/forum/attachment/41479 "required.JPG") [ ](/forum/attachment/41479?download=1 "required.JPG")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg5MjkxNy1yZXF1aXJlZC1maWxlZC1ub3QtYmVpbmctZW5mb3JjZWQtdXBvbi1jaGVja291dD90bXBsPW1hcmtkb3du) 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?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86359
- Thank you received: 14293
-
-

8 years 11 months ago [\#283309](#283309) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Required filed not being enforced upon checkout.](/forum/27-checkout/892917-required-filed-not-being-enforced-upon-checkout#283309 "-- HikaShop version -- : 3.2.1 -- Joomla version -- : 3.8.2 -- PHP version -- : 7.0.25 -- Browser(s) name and version -- : Firefox 57.0  Greetings.  We are located in the United States.  One of our clients is in Florida. It must therefore remit both state and local taxes.The local taxes are county taxes.  We modified the Hikashop setup by changing the country to be a US state and the State to be a Florida county on our site. Our issue is not with the tax, but with making the State and county fields required without a Default value.  Our configuration in the backend displays State and Local fields are required fields.  At first, people were neglecting to select the proper County since by default the system kept the first alphabetic County as a selection (that created the wrong tax amount for the customer)  So we thought best to have &quot;&#42;&#42;select your state&quot; or &quot;&#42;&#42;select your county if in FL&quot; in the zones under the Country and State. So, we created those entries, and now that is the first thing they see. Doing so created another issue. The required field was being bypassed by having the selection of &quot;&#42;&#42;select your state&quot; or &quot;&#42;&#42;slect your county if in FL.&quot; since they were the default value options.  Now the customer can checkout without proper State or Local values selected and tax applied.  A recent order cought our attention when a customer was able to process their order without selecting the County and therefore the additional local tax was not applied.  In summary: During checkout, if a client selects Florida for an address, a required field of a county must be selected to complete the order apply the porper taxes then process the payment. We have the field set to be required, but that requirment is not being enforced becaus the default value we have is &quot;&#42;&#42;select your county if in FL&quot; that is making the the system recognize the field as filled already.  Thus my succinct question: Any ideas on how to make that field required but without a default value so that it alerts the customer they must select a county when Florida is selected as the state?  Thank you for your help is this matter.")*

Hi,

Thank you for the details.

Remove the code: Code:

if($field-&gt;field_required &amp;&amp; @$field-&gt;field_options['zone_type'] == 'state') return true;

from the file administrator/components/com_hikashop/classes/field.php and that will fix the problem.

The following user(s) said Thank You: [solia](/forum/user/10273-solia "View solia's Profile")

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

- **[solia](/forum/user/10273-solia "View solia's Profile")**
- [![solia's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar10273.jpg)](/forum/user/10273-solia "View solia's Profile") Topic Author
- [ Offline](/forum/user/10273-solia)

Less More

- Posts: 30
- Thank you received: 2
-
-

8 years 11 months ago [\#283322](#283322) by [solia](/forum/user/10273-solia "View solia's Profile")  Replied by *[solia](/forum/user/10273-solia "View solia's Profile")* on topic *[Required filed not being enforced upon checkout.](/forum/27-checkout/892917-required-filed-not-being-enforced-upon-checkout#283322 "-- HikaShop version -- : 3.2.1 -- Joomla version -- : 3.8.2 -- PHP version -- : 7.0.25 -- Browser(s) name and version -- : Firefox 57.0  Greetings.  We are located in the United States.  One of our clients is in Florida. It must therefore remit both state and local taxes.The local taxes are county taxes.  We modified the Hikashop setup by changing the country to be a US state and the State to be a Florida county on our site. Our issue is not with the tax, but with making the State and county fields required without a Default value.  Our configuration in the backend displays State and Local fields are required fields.  At first, people were neglecting to select the proper County since by default the system kept the first alphabetic County as a selection (that created the wrong tax amount for the customer)  So we thought best to have &quot;&#42;&#42;select your state&quot; or &quot;&#42;&#42;select your county if in FL&quot; in the zones under the Country and State. So, we created those entries, and now that is the first thing they see. Doing so created another issue. The required field was being bypassed by having the selection of &quot;&#42;&#42;select your state&quot; or &quot;&#42;&#42;slect your county if in FL.&quot; since they were the default value options.  Now the customer can checkout without proper State or Local values selected and tax applied.  A recent order cought our attention when a customer was able to process their order without selecting the County and therefore the additional local tax was not applied.  In summary: During checkout, if a client selects Florida for an address, a required field of a county must be selected to complete the order apply the porper taxes then process the payment. We have the field set to be required, but that requirment is not being enforced becaus the default value we have is &quot;&#42;&#42;select your county if in FL&quot; that is making the the system recognize the field as filled already.  Thus my succinct question: Any ideas on how to make that field required but without a default value so that it alerts the customer they must select a county when Florida is selected as the state?  Thank you for your help is this matter.")*

That worked perfectly. Thank you so much for the fix and the awesome support!

Nadine

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg5MjkxNy1yZXF1aXJlZC1maWxlZC1ub3QtYmVpbmctZW5mb3JjZWQtdXBvbi1jaGVja291dD90bXBsPW1hcmtkb3du) 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.064 seconds

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