Fix: The 'VAT Number' field is not displayed correctly in the signup page

  • Impression eStudio
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
6 years 2 months ago - 6 years 2 months ago #108499 by Impression eStudio
Hi,

In the sign up page, at the left of the field 'VAT Number' there is a box displaying the country code. This box and the field are not in the same line as supposed to be, like the fields 'Price', 'Tax Amount' etc.

In order this to be fixed, in the file 'components\com_osmembership\view\register\tmpl\default.php' the lines 216-217 containing the code:
Code:
$('input[name^=<?php echo $this->config->eu_vat_number_field ?>]').before('<div class="<?php echo $inputPrependClass; ?> inline-display"><span class="<?php echo $addOnClass; ?>" id="vat_country_code"><?php echo $this->countryCode; ?></span>'); $('input[name^=<?php echo $this->config->eu_vat_number_field ?>]').after('<span class="invalid" id="vatnumber_validate_msg" style="display: none;"><?php echo ' '.JText::_('OSM_INVALID_VATNUMBER'); ?></span></div>');
must be changed to:
Code:
$('input[name^=<?php echo $this->config->eu_vat_number_field ?>]').before('<div class="<?php echo $inputPrependClass; ?> inline-display"><span class="<?php echo $addOnClass; ?>" id="vat_country_code"><?php echo $this->countryCode; ?></span><span class="invalid" id="vatnumber_validate_msg" style="display: none;"><?php echo ' '.JText::_('OSM_INVALID_VATNUMBER'); ?></span></div>'); $('input[name^=<?php echo $this->config->eu_vat_number_field ?>]').insertAfter($('#field_<?php echo $this->config->eu_vat_number_field.' .'.$addOnClass; ?> '));

I hope that this will be included in the next version.

Thanos
Last edit: 6 years 2 months ago by Impression eStudio.

Please Log in or Create an account to join the conversation.

More
6 years 2 months ago #108539 by Tuan Pham Ngoc
Hi Thanos

I don't think we have to change PHP code to solve it. For issue like this, I believe it causes by conflict with css of your site template somehow, so adding some small custom css code should solve it

Maybe you can remove your change, then submit a support ticket sending us super admin account of your site and link to the page, our support staff will solve the issue in properly way for you

Regards,

Tuan

Please Log in or Create an account to join the conversation.

  • Impression eStudio
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
6 years 2 months ago #108554 by Impression eStudio
Hi Tuan,

It is very possible that you are right.
But I think that there is a logical error in your code.
The first line of this Javascript code adds a div without closing it.
The second line of code is trying to add a new element and close that div.
I believe that after the first line is executed, the browser tries to fix the open div and closes it buy itself.
So when the second line of code can't work successfully and the new element is added outside this div.

Thanos

Please Log in or Create an account to join the conversation.