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

#   Custom Field Validation

##

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

Less More

- Posts: 8
- Thank you received: 1
-
-

12 years 3 months ago [\#165071](#165071) by [slittle](/forum/user/33192-slittle "View slittle's Profile")  *[Custom Field Validation](/forum/31-development/869889-custom-field-validation#165071 "-- HikaShop version -- : 2.3.2 -- Joomla version -- : 3.3 -- PHP version -- : 5.4.26  I've seen a few brief discussions about custom validation of custom fields... but none of them have been very helpful thus far.  I'm adept at building custom Javascript &amp; php code and have some special validation that needs to be performed on a custom field on the checkout/registration form... I've looked and looked but can't seem to find the proper place to hack in a quick ajax call to the server to validate the field and either permit or prevent the form submitting (and displaying an error message). Suggestions?")* was created by *[slittle](/forum/user/33192-slittle "View slittle's Profile")*

-- HikaShop version -- : 2.3.2
-- Joomla version -- : 3.3
-- PHP version -- : 5.4.26

I've seen a few brief discussions about custom validation of custom fields... but none of them have been very helpful thus far.

I'm adept at building custom Javascript &amp; php code and have some special validation that needs to be performed on a custom field on the checkout/registration form... I've looked and looked but can't seem to find the proper place to hack in a quick ajax call to the server to validate the field and either permit or prevent the form submitting (and displaying an error message). Suggestions?

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

- **[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")**
- [![Mohamed Thelji's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6861.png)](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")
- [ Offline](/forum/user/6861-mohamed-thelji)

Less More

- Posts: 12953
- Thank you received: 1778
-
-
-

12 years 3 months ago [\#165078](#165078) by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")  Replied by *[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")* on topic *[Custom Field Validation](/forum/31-development/869889-custom-field-validation#165078 "-- HikaShop version -- : 2.3.2 -- Joomla version -- : 3.3 -- PHP version -- : 5.4.26  I've seen a few brief discussions about custom validation of custom fields... but none of them have been very helpful thus far.  I'm adept at building custom Javascript &amp; php code and have some special validation that needs to be performed on a custom field on the checkout/registration form... I've looked and looked but can't seem to find the proper place to hack in a quick ajax call to the server to validate the field and either permit or prevent the form submitting (and displaying an error message). Suggestions?")*

Hello,
Can you tell me what kind of custom field you want to use and how do you exactly want to edit it ?

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

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

Less More

- Posts: 8
- Thank you received: 1
-
-

12 years 3 months ago [\#165187](#165187) by [slittle](/forum/user/33192-slittle "View slittle's Profile")  Replied by *[slittle](/forum/user/33192-slittle "View slittle's Profile")* on topic *[Custom Field Validation](/forum/31-development/869889-custom-field-validation#165187 "-- HikaShop version -- : 2.3.2 -- Joomla version -- : 3.3 -- PHP version -- : 5.4.26  I've seen a few brief discussions about custom validation of custom fields... but none of them have been very helpful thus far.  I'm adept at building custom Javascript &amp; php code and have some special validation that needs to be performed on a custom field on the checkout/registration form... I've looked and looked but can't seem to find the proper place to hack in a quick ajax call to the server to validate the field and either permit or prevent the form submitting (and displaying an error message). Suggestions?")*

It's a simple text field (a number actually) into which a new user will enter a number... I need to query the database before the form is submitted to ensure that number exists in a particular table. If it does not I need to prevent Hikashop from processing the registration form and creating the new user/order until the user enters a valid number.

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

12 years 3 months ago [\#165296](#165296) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Custom Field Validation](/forum/31-development/869889-custom-field-validation#165296 "-- HikaShop version -- : 2.3.2 -- Joomla version -- : 3.3 -- PHP version -- : 5.4.26  I've seen a few brief discussions about custom validation of custom fields... but none of them have been very helpful thus far.  I'm adept at building custom Javascript &amp; php code and have some special validation that needs to be performed on a custom field on the checkout/registration form... I've looked and looked but can't seem to find the proper place to hack in a quick ajax call to the server to validate the field and either permit or prevent the form submitting (and displaying an error message). Suggestions?")*

Hi,

So the field is of the table "user" or "address" I guess.
In that case, you want to edit the file "registration" (or "registration_bootstrap" if you have turned on the "use bootstrap option of the configuration) via the menu Display&gt;Views and change the line:
echo $this-&gt;cartClass-&gt;displayButton($registerButtonName,'register',$this-&gt;params,hikashop_currentUrl(),' hikashopSubmitForm(\''.$this-&gt;form_name.'\'); return false;','id="hikashop_register_form_button"');

You'll want to put the call to hikashopSubmitForm(\''.$this-&gt;form_name.'\'); in a if statement with your ajax check so that the form is sent only if your check is valid.

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

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

[](#top)
