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

#   Query of Code in Address (address/form.php)

##

- **[Ed\_Hika](/forum/user/33922-ed-hika "View Ed&#95;Hika's Profile")**
- [![Ed&#95;Hika's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/33922-ed-hika "View Ed&#95;Hika's Profile") Topic Author
- [ Offline](/forum/user/33922-ed-hika)

Less More

- Posts: 109
- Thank you received: 5
-
-

11 years 9 months ago [\#189110](#189110) by [Ed\_Hika](/forum/user/33922-ed-hika "View Ed&#95;Hika's Profile")  *[Query of Code in Address (address/form.php)](/forum/33-customers/874701-query-of-code-in-address-address-form-php#189110 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6  Hello, there.  Good afternoon!  I have the following query about the hikashopCheckChangeForm code when the &quot;OK&quot; button is clicked in the address/form.php code.  This code doesn't seem to be executed when the &quot;OK&quot; button is clicked.  What is the purpose of this code? When is it run?  Thanks.  Take care!")* was created by *[Ed\_Hika](/forum/user/33922-ed-hika "View Ed&#95;Hika's Profile")*

-- HikaShop version -- : 2.3.4
-- Joomla version -- : 3.3.6

Hello, there.

Good afternoon!

I have the following query about the hikashopCheckChangeForm code when the "OK" button is clicked in the address/form.php code.
Code:

echo $this-&gt;cart-&gt;displayButton(JText::_('OK'),'ok',$this-&gt;params,hikashop_completeLink('address&amp;task=save'),'if(hikashopCheckChangeForm(\'address\',\'hikashop_address_form\')) document.forms[\'hikashop_address_form\'].submit(); return false;');

This code doesn't seem to be executed when the "OK" button is clicked.

What is the purpose of this code? When is it run?

Thanks.

Take care!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NzQ3MDEtcXVlcnktb2YtY29kZS1pbi1hZGRyZXNzLWFkZHJlc3MtZm9ybS1waHA/dG1wbD1tYXJrZG93bg==) 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: 86586
- Thank you received: 14325
-
-

11 years 9 months ago [\#189147](#189147) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Query of Code in Address (address/form.php)](/forum/33-customers/874701-query-of-code-in-address-address-form-php#189147 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6  Hello, there.  Good afternoon!  I have the following query about the hikashopCheckChangeForm code when the &quot;OK&quot; button is clicked in the address/form.php code.  This code doesn't seem to be executed when the &quot;OK&quot; button is clicked.  What is the purpose of this code? When is it run?  Thanks.  Take care!")*

Hi,

I don't see why it wouldn't be executed. That code is run when you click on the button in order to check that the required data has been entered by the customer before validating the form submission.
Are you sure that you're looking at the correct view file for the correct page on your website ?
The address/form.php might not be used on the checkout based on how you configured your checkout. Instead, it could be the address/show.php which could be used.

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

- **[Ed\_Hika](/forum/user/33922-ed-hika "View Ed&#95;Hika's Profile")**
- [![Ed&#95;Hika's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/33922-ed-hika "View Ed&#95;Hika's Profile") Topic Author
- [ Offline](/forum/user/33922-ed-hika)

Less More

- Posts: 109
- Thank you received: 5
-
-

11 years 9 months ago [\#189539](#189539) by [Ed\_Hika](/forum/user/33922-ed-hika "View Ed&#95;Hika's Profile")  Replied by *[Ed\_Hika](/forum/user/33922-ed-hika "View Ed&#95;Hika's Profile")* on topic *[Query of Code in Address (address/form.php)](/forum/33-customers/874701-query-of-code-in-address-address-form-php#189539 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6  Hello, there.  Good afternoon!  I have the following query about the hikashopCheckChangeForm code when the &quot;OK&quot; button is clicked in the address/form.php code.  This code doesn't seem to be executed when the &quot;OK&quot; button is clicked.  What is the purpose of this code? When is it run?  Thanks.  Take care!")*

Thanks, Nicolas.

Yes, you are right. It does get executed. Apologies for the wild goose chase.

I have another question regarding the function (or rather the hikashopCheckField function).

Instead of a popup message appearing when a validation error is found, I like the error message to be displayed inline (for instance, have the label of the input box replaced). As an example, say the post code box does not have a value and the "OK" button is clicked, the label for the post code box will now say "Please enter a value for the field Postcode".

I have modified the following code in hikashopCheckField from
Code:

alert(hikashopFieldsJs['validFieldsComp'][type][i]);

to
Code:

var labelName = 'label_' + elementToCheck.id; window.Oby.updateElem(labelName, hikashopFieldsJs['validFieldsComp'][type][i]);

Note that I have added the id for the label in the function getFieldName (in /administrator/components/com_hikashop/classes/field.php) as follows.
Code:

return '&lt;label id="label_' .$field-&gt;field_namekey. '" for="'.$this-&gt;prefix.$field-&gt;field_namekey.$this-&gt;suffix.'"&gt;'.$this-&gt;trans($field-&gt;field_realname).$required.'&lt;/label&gt;';

Unfortunately, the new label is not displayed. I think what I am missing is a call to the document.ready function.

Please could you direct me on how I can get the code to work to show the new label? Do I need to all the window.Oby.ready function? If so, what is the parameter to pass in?

Thanks.

Take care!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NzQ3MDEtcXVlcnktb2YtY29kZS1pbi1hZGRyZXNzLWFkZHJlc3MtZm9ybS1waHA/dG1wbD1tYXJrZG93bg==) 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: 86586
- Thank you received: 14325
-
-

11 years 9 months ago [\#189565](#189565) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Query of Code in Address (address/form.php)](/forum/33-customers/874701-query-of-code-in-address-address-form-php#189565 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6  Hello, there.  Good afternoon!  I have the following query about the hikashopCheckChangeForm code when the &quot;OK&quot; button is clicked in the address/form.php code.  This code doesn't seem to be executed when the &quot;OK&quot; button is clicked.  What is the purpose of this code? When is it run?  Thanks.  Take care!")*

Hi,

You don't need to use Oby.ready and it wouldn't help.
The code you gave sounds correct for what you want to do.
Are you sure that labelName matches with the id of the label in the HTML ?

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

- **[Ed\_Hika](/forum/user/33922-ed-hika "View Ed&#95;Hika's Profile")**
- [![Ed&#95;Hika's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/33922-ed-hika "View Ed&#95;Hika's Profile") Topic Author
- [ Offline](/forum/user/33922-ed-hika)

Less More

- Posts: 109
- Thank you received: 5
-
-

11 years 9 months ago [\#190027](#190027) by [Ed\_Hika](/forum/user/33922-ed-hika "View Ed&#95;Hika's Profile")  Replied by *[Ed\_Hika](/forum/user/33922-ed-hika "View Ed&#95;Hika's Profile")* on topic *[Query of Code in Address (address/form.php)](/forum/33-customers/874701-query-of-code-in-address-address-form-php#190027 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6  Hello, there.  Good afternoon!  I have the following query about the hikashopCheckChangeForm code when the &quot;OK&quot; button is clicked in the address/form.php code.  This code doesn't seem to be executed when the &quot;OK&quot; button is clicked.  What is the purpose of this code? When is it run?  Thanks.  Take care!")*

Thanks, Nicolas.

Yes, the labels match.

I have since discovered code samples used in Hikashop on how to call the function and it (appears to) work.

Thanks.

Take care!

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

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