- Posts: 8
- Thank you received: 0
Placeholder in registration form
11 years 8 months ago #187243
by anilban
Placeholder in registration form was created by anilban
-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.3.3
-- PHP version -- : 5.4.7
We are using hikashop user registration form. I want to insert a placeholder in email address. Saying "activation link will be send to your email id" Also keeping an instruction to check spam box in case you don't receive an email.
How can i put placeholders
-- Joomla version -- : 3.3.3
-- PHP version -- : 5.4.7
We are using hikashop user registration form. I want to insert a placeholder in email address. Saying "activation link will be send to your email id" Also keeping an instruction to check spam box in case you don't receive an email.
How can i put placeholders
Please Log in or Create an account to join the conversation.
11 years 8 months ago #187247
by lousyfool
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" )
Replied by lousyfool on topic Placeholder in registration form
You'll need to edit the view "user / registration" or "user / registration_bootstrap" (depending on your system configuration for "Use bootstrap design") for your frontend template via the menu Display -> Views, and add the placeholder attribute to the input fields.
However, please allow me to wonder: it's quite a long placeholder text for a small form field. Perhaps you want to insert another tr/td (or div, respectively) for this. Or, isn't there a Joomla message coming up upon click on the "Register" button, already telling about the activation link mail? This message can be edited via language override, so you can add the spam box hint to it as well.
Anyway, your decision what to do how, of course.
However, please allow me to wonder: it's quite a long placeholder text for a small form field. Perhaps you want to insert another tr/td (or div, respectively) for this. Or, isn't there a Joomla message coming up upon click on the "Register" button, already telling about the activation link mail? This message can be edited via language override, so you can add the spam box hint to it as well.
Anyway, your decision what to do how, of course.
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" )
Please Log in or Create an account to join the conversation.
11 years 8 months ago - 11 years 8 months ago #187271
by anilban
Replied by anilban on topic Placeholder in registration form
I get cases where people register with wrong email id and then register with correct id. Also in case email goes to through spam box then register twice, thrice.
Hence thought about placing a place holder to avoid these things. Is there a better way of doing this?
prntscr.com/5ub0dr
Also how do i remove E-mail confirmation and Verify Password.
I have made changes in user / registration_bootstrap.php
Code as below :
Hence thought about placing a place holder to avoid these things. Is there a better way of doing this?
prntscr.com/5ub0dr
Also how do i remove E-mail confirmation and Verify Password.
I have made changes in user / registration_bootstrap.php
Code as below :
Code:
<?php
/**
* @package HikaShop for Joomla!
* @version 2.3.0
* @author hikashop.com
* @copyright (C) 2010-2014 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><fieldset class="form-horizontal">
<?php
if($this->display_method==1){
$this->simplified_registration=explode(',',$this->simplified_registration);
if(in_array('2',$this->simplified_registration)){ $registration=2; }
if(in_array('0',$this->simplified_registration)){ $registration=0; }
if(in_array('1',$this->simplified_registration)){ $registration=1; }
if(in_array('3',$this->simplified_registration)){ $registration=3; }
$this->simplified_registration = $registration;
}
if(!$this->simplified_registration){ ?>
<div class="control-group hikashop_registration_name_line" id="hikashop_registration_name_line">
<div class="control-label">
<label id="namemsg" for="register_name" class="required" title=""><?php echo JText::_( 'HIKA_USER_NAME' ); ?></label>
</div>
<div class="controls">
<input type="text" name="data[register][name]" id="register_name" value="<?php echo $this->escape($this->mainUser->get( 'name' ));?>" class="required" size="30" maxlength="50" <?php if (!empty($this->registration_page)) echo ' aria-required="true" required="required"'; ?>> *
</div>
</div>
<div class="control-group hikashop_registration_username_line" id="hikashop_registration_username_line">
<div class="control-label">
<label id="usernamemsg" for="register_username" class="required" title=""><?php echo JText::_( 'HIKA_USERNAME' ); ?></label>
</div>
<div class="controls">
<input type="text" name="data[register][username]" id="register_username" value="<?php echo $this->escape($this->mainUser->get( 'username' ));?>" class="required validate-username" maxlength="25" size="30" <?php if (!empty($this->registration_page)) echo ' aria-required="true" required="required"'; ?>> *
</div>
</div>
<?php }?>
<div class="control-group hikashop_registration_email_line">
<div class="control-label">
<label id="emailmsg" for="register_email" class="required" title=""><?php echo JText::_( 'HIKA_EMAIL' ); ?></label>
</div>
<div class="controls">
<input type="text" name="data[register][email]" placeholder="activation link will be send" id="register_email" value="<?php echo $this->escape($this->mainUser->get( 'email' ));?>" class="required validate-email" maxlength="100" size="30"<?php if (!empty($this->registration_page)) echo ' aria-required="true" required="required"'; ?>> *
</div>
</div>
<?php if($this->config->get('show_email_confirmation_field',0)){ ?>
<div class="control-group hikashop_registration_email_confirm_line">
<div class="control-label">
<label id="email_confirm_msg" for="register_email_confirm" class="required" title=""><?php echo JText::_( 'HIKA_EMAIL_CONFIRM' ); ?></label>
</div>
<div class="controls">
<input type="text" name="data[register][email_confirm]" id="register_email_confirm" value="<?php echo $this->escape($this->mainUser->get( 'email' ));?>" class="required validate-email" maxlength="100" size="30" <?php if (!empty($this->registration_page)) echo ' aria-required="true" required="required"'; ?> onchange="if(this.value!=document.getElementById('register_email').value){alert('<?php echo JText::_('THE_CONFIRMATION_EMAIL_DIFFERS_FROM_THE_EMAIL_YOUR_ENTERED',true); ?>'); this.value = '';}"> *
</div>
</div>
<?php
}
if(!$this->simplified_registration || $this->simplified_registration == 3){ ?>
<div class="control-group hikashop_registration_password_line" id="hikashop_registration_password_line">
<div class="control-label">
<label id="pwmsg" for="register_password" class="required" title=""><?php echo JText::_( 'HIKA_PASSWORD' ); ?></label>
</div>
<div class="controls">
<input type="password" name="data[register][password]" id="register_password" value="" class="required validate-password" size="30" <?php if (!empty($this->registration_page)) echo ' aria-required="true" required="required"'; ?>> *
</div>
</div>
<div class="control-group hikashop_registration_password2_line" id="hikashop_registration_password2_line">
<div class="control-label">
<label id="pw2msg" for="register_password2" class="required" title=""><?php echo JText::_( 'HIKA_VERIFY_PASSWORD' ); ?></label>
</div>
<div class="controls">
<input type="password" name="data[register][password2]" id="register_password2" value="" class="required validate-password" size="30" <?php if (!empty($this->registration_page)) echo ' aria-required="true" required="required"'; ?>> *
</div>
</div>
<?php }
$this->setLayout('custom_fields_bootstrap');
$this->type = 'user';
echo $this->loadTemplate();
if($this->config->get('affiliate_registration',0)){ ?>
<div class="control-group hikashop_registration_password2_line">
<div class="controls">
<?php
$affiliate_terms = $this->config->get('affiliate_terms',0);
if(!empty($affiliate_terms)){
?>
<input class="hikashop_affiliate_checkbox" id="hikashop_affiliate_checkbox" type="checkbox" name="hikashop_affiliate_checkbox" value="1" <?php echo $this->affiliate_checked; ?> />
<span class="hikashop_affiliate_terms_span_link" id="hikashop_affiliate_terms_span_link">
<a class="hikashop_affiliate_terms_link" id="hikashop_affiliate_terms_link" target="_blank" href="<?php echo JRoute::_('index.php?option=com_content&view=article&id='.$affiliate_terms); ?>"><?php echo JText::_('BECOME_A_PARTNER'); ?></a>
</span>
<?php
} else {
?> <label class="checkbox">
<input class="hikashop_affiliate_checkbox" id="hikashop_affiliate_checkbox" type="checkbox" name="hikashop_affiliate_checkbox" value="1" <?php echo $this->affiliate_checked; ?> />
<?php echo JText::_('BECOME_A_PARTNER');?>
</label>
<?php
}
?>
</div>
</div>
<?php }
if($this->config->get('address_on_registration',1)){
?>
<div class=""><legend><?php echo JText::_( 'ADDRESS_INFORMATION' ); ?></legend></div>
<?php
$this->type = 'address';
echo $this->loadTemplate();
}
?>
<div class="control-group hikashop_registration_required_info_line">
<div class="controls"><?php echo JText::_( 'HIKA_REGISTER_REQUIRED' ); ?></div>
</div>
<input type="hidden" name="data[register][id]" value="<?php echo (int)$this->mainUser->get( 'id' );?>" />
<input type="hidden" name="data[register][gid]" value="<?php echo (int)$this->mainUser->get( 'gid' );?>" />
<?php
if(empty($this->form_name)){
$this->form_name = 'hikashop_checkout_form';
}
?>
<div class="control-group">
<div class="controls">
<?php
$registerButtonName=JText::_('HIKA_REGISTER');
if($this->simplified_registration==2){
$registerButtonName=JText::_('HIKA_NEXT');
}
echo $this->cartClass->displayButton($registerButtonName,'register',$this->params,'',' hikashopSubmitForm(\''.$this->form_name.'\'); return false;','id="hikashop_register_form_button"', 0, 1, 'btn btn-primary'); //hikashopSubmitForm(\''.$this->form_name.'\');
$button = $this->config->get('button_style','normal');
if ($button=='css')
echo '<input type="submit" style="position: absolute; left: -9999px; width: 1px; height: 1px;"/></input>';
?>
</div>
</div>
</fieldset>
Last edit: 11 years 8 months ago by Xavier. Reason: Use of [code]...[/code] tags
Please Log in or Create an account to join the conversation.
11 years 8 months ago #187294
by lousyfool
What's "better" or "worse" is up to you to decide, of course.
I had already mentioned two other ways, but now, since you shortened the placeholder text, you seem to have what you originally wanted.
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" )
Replied by lousyfool on topic Placeholder in registration form
anilban wrote: Is there a better way of doing this?
What's "better" or "worse" is up to you to decide, of course.
I had already mentioned two other ways, but now, since you shortened the placeholder text, you seem to have what you originally wanted.
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" )
Please Log in or Create an account to join the conversation.
11 years 8 months ago #187298
by Jerome
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.
Replied by Jerome on topic Placeholder in registration form
Hi,
There is an option for that in the HikaShop configuration.
About the password confirmation, even if you remove it from the view, the controller need it ; so it won't work unless you modify also the controller.
The modification of the core files is not something recommended
Regards,
The answer is directly in the code you posted :Also how do i remove E-mail confirmation and Verify Password.
Code:
if($this->config->get('show_email_confirmation_field',0))
About the password confirmation, even if you remove it from the view, the controller need it ; so it won't work unless you modify also the controller.
The modification of the core files is not something recommended
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.
Please Log in or Create an account to join the conversation.
Time to create page: 0.222 seconds