how to add default values to registration field

  • Posts: 490
  • Thank you received: 2
7 years 8 months ago #248308

-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.4.3
-- PHP version -- : 5.5
-- Error-message(debug-mod must be tuned on) -- : none

hi

i would like to add default values to the registration field, could you guide me on the best way to do this? hoping to edit
components/com_users/models/forms/registration.xml

<field
name="name"
type="text"
description="COM_USERS_REGISTER_NAME_DESC"
filter="string"
label="COM_USERS_REGISTER_NAME_LABEL"
required="true"
size="30"
value="Select a nice username!"
/>

i dont know if this will result in an issue with hikashop? or it might get overridden.

Anyway something like below with default values




thanks

Attachments:

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

  • Posts: 2143
  • Thank you received: 747
7 years 8 months ago #248311

Hi,

Here's a neat little Joomla plugin that lets you override form XMLs: icueproject.com/downloads/override-xml-forms
I haven't tried it with Joomla 3.6.x, yet, but with previous versions it worked perfectly fine.

Hint: What you probably want isn't value but placeholder attributes, e.g. in the form

placeholder="First name"


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )
Last edit: 7 years 8 months ago by lousyfool. Reason: w3schools link
The following user(s) said Thank You: ronron

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

  • Posts: 26032
  • Thank you received: 4006
  • MODERATOR
7 years 8 months ago #248310

Hi,

Please read the "custom field" documentation.
www.hikashop.com/support/documentation/i...ield-form.html#infos

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: ronron

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

  • Posts: 490
  • Thank you received: 2
7 years 8 months ago #248378

hi lousyfool

thank you

i cant get it to work

this is the xml file i want to add placeholders

/components/com_users/models/forms/registration.xml

and i added it here

/templates/system/form/com_users/registration.xml

this is the override




is this correct?

Attachments:
Last edit: 7 years 8 months ago by ronron.

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

  • Posts: 490
  • Thank you received: 2
7 years 8 months ago #248379

thank jerome

Hi,

Please read the "custom field" documentation.
www.hikashop.com/support/documentation/i...ield-form.html#infos

Regards,


i think this, above, is for custom fields

im trying to add a place holder to fields on the registration form

<input type="text" name="data[register][name]" id="register_name" value="" class="required" size="30" maxlength="50" aria-required="true" required="required" placeholder="nice name">

any tips to do this on hikashop?

thanks

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

  • Posts: 2143
  • Thank you received: 747
7 years 8 months ago #248380

Hi,

You seem to have found it already, but this is all I can point you at: icueproject.com/products/override-xml-forms
Make sure you got it all right.
It worked for me and, sorry, more I can't say without digging deeper into your site - not to mention that the HikaShop support forum isn't the place to go into more details of 3rd-party code.


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )
The following user(s) said Thank You: ronron

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

  • Posts: 81677
  • Thank you received: 13102
  • MODERATOR
7 years 8 months ago #248385

Hi,

The code:

<input type="text" name="data[register][name]" id="register_name" value="" class="required" size="30" maxlength="50" aria-required="true" required="required" placeholder="nice name">
comes from the HikaShop registration form.
To add a place holder in there, you need to edit the file "registration" (or "registration_bootstrap" if the "use bootstrap design" setting is activated) via the menu Display>Views:
<input type="text" name="data[register][name]" id="register_name" value="<?php echo $this->escape($this->mainUser->get( 'name' ));?>" class="inputbox required" maxlength="50" /> *

The following user(s) said Thank You: ronron

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

Time to create page: 0.085 seconds
Powered by Kunena Forum