In the code above how can I search for editEntidadeXXX on the name attribute and then insert this value on the id attribute?
Something like editEntidade(\w)+ will found the names but it is possible to insert that values on the edit attribute?
<div class="control-group column-group horizontal-gutters">
<label class="large-15 small-100 content-right" for="editEntidadeRua">Rua</label>
<div class="control large-40 medium-40 small-100">
<input type="text" id="editEntidade" name="editEntidadeRua" value="<?php echo html_escape($entidadeValues['rua']) ?>">
</div>
</div>
<div class="control-group column-group horizontal-gutters">
<label class="large-15 small-100 content-right" for="editEntidadeCodpostal">Código Postal</label>
<div class="control large-10 medium-10 small-100">
<input type="text" id="editEntidade" name="editEntidadeCodpostal" value="<?php echo html_escape($entidadeValues['codpostal']) ?>">
</div>
</div>
Find What:
id="editEntidade"(\s+)name="editEntidade(\w+)"
Replace With:
id="editEntidade$2" name="editEntidade$2"
Related
Is it possible to adjust / remove entry fields on registration page?
Image:
In admin panel go to Customer > Custom Field
Here you can add any custom field you want. Just check Required before saving new field, and enable it. After that you will see it in your registration page.
Removing unnecessary field, like Fax
Open catalog/view/theme/default/template/account/register.tpl
Find following
<div class="form-group">
<label class="col-sm-2 control-label" for="input-fax"><?php echo $entry_fax; ?></label>
<div class="col-sm-10">
<input type="text" name="fax" value="<?php echo $fax; ?>" placeholder="<?php echo $entry_fax; ?>" id="input-fax" class="form-control" />
</div>
</div>
Replace it with following (using same name="fax" as above)
<input type="hidden" name="fax" value="" />
Removing necessary field, like Address
Do everything from the previous chapter
Open catalog/view/theme/default/template/account/register.tpl
Find following
<div class="form-group required">
<label class="col-sm-2 control-label" for="input-address-1"><?php echo $entry_address_1; ?></label>
<div class="col-sm-10">
<input type="text" name="address_1" value="<?php echo $address_1; ?>" placeholder="<?php echo $entry_address_1; ?>" id="input-address-1" class="form-control" />
<?php if ($error_address_1) { ?>
<div class="text-danger"><?php echo $error_address_1; ?></div>
<?php } ?>
</div>
</div>
Replace it with following (using same name="fax" as above)
<input type="hidden" name="address_1" value="" />
Now open catalog/controller/account/register.php
Find private function validate() {, Inside of this function we can see all validations.
Look for
if ((utf8_strlen(trim($this->request->post['address_1'])) < 3) || (utf8_strlen(trim($this->request->post['address_1'])) > 128)) {
$this->error['address_1'] = $this->language->get('error_address_1');
}
and remove (or comment) it.
<div class="form-group required">
<label class="col-sm-2 control-label" for="input-telephone1">Confirm Telephone</label>
<div class="col-sm-10">
<input type="tel" name="telephone1" value="" placeholder="Confirm Telephone" id="input-telephone1" class="form-control" required/>
<?php if ($error_telephone1) { ?>
<div class="text-danger"><?php echo $error_telephone1; ?></div>
<?php } ?>
</div>
</div>
I am getting an error message even though I have already defined a variable in language and controller. Error message is given below:
errorNotice: Undefined variable: error_telephone1 in /home/chaarms/public_html/catalog/view/theme/default/template/account/register.tpl on line 85
in corresponding controller file, in your case catalog/controller/account/register.php you should define it:
$data['error_telephone1'] = "some code where from you want to get this info";
for example if you want to add some text code should be next:
$data['error_telephone1'] = $this->language->get('error_telephone1');
and in corresponding language file add:
$_['error_telephone1'] = 'Telephone error!!!';
that's all.
Radio button list appear vertically rather than horizontally. Appears alright on Chrome and Firefox. We are using angular js 1.7.
radio group from IE 11
radio group from Firefox 60.3.0 esr
HTML code snippet for the radio group
HTML Code:
<div ng-if="feedbackChoices && feedbackChoices.length > 1" id="629934096_not_helpful" class="choiceText f-b-choices-body ng-scope" ng-show="showChoices">
<br>
<div class="responsePrompt ng-scope" translate="">Where did we go wrong?</div>
<br>
<ul class="selectionRadio f-b-choices selectionGroup629934096_feedback_choices">
<!-- ngRepeat: choice in feedbackChoices --><li ng-repeat="choice in feedbackChoices" class="ng-scope">
<div>
<label><input id="948060864" class="f-b-input" name="selectionGroup" ng-click="submitFeedbackChoice(choice)" type="radio">
<label for="948060864" class="f-b-choices-label ng-scope ng-binding" translate="">The instructions did not apply</label>
</label>
</div>
</li><!-- end ngRepeat: choice in feedbackChoices --><li ng-repeat="choice in feedbackChoices" class="ng-scope">
<div>
<label><input id="948060864_2" class="f-b-input" name="selectionGroup" ng-click="submitFeedbackChoice(choice)" type="radio">
<label for="948060864_2" class="f-b-choices-label ng-scope ng-binding" translate="">The instructions were too long/hard to follow</label>
</label>
</div>
</li><!-- end ngRepeat: choice in feedbackChoices --><li ng-repeat="choice in feedbackChoices" class="ng-scope">
<div>
<label><input id="948060864_3" class="f-b-input" name="selectionGroup" ng-click="submitFeedbackChoice(choice)" type="radio">
<label for="948060864_3" class="f-b-choices-label ng-scope ng-binding" translate="">I need you to do this for me</label>
</label>
</div>
</li><!-- end ngRepeat: choice in feedbackChoices -->
</ul>
</div>
I have a simple input radio for toggling between active and inactive. I can not figure out how to get Ember to tie this to the model. My RAW html currently looks like this:
<fieldset class="checkboxes">
<label class="active" for="is_active">
<input type="radio" id="is_active" name="status" value="1" checked="">
<span>Active</span>
<div class="input"></div>
</label>
<label class="sep">/</label>
<label class="inactive" for="inactive">
<input type="radio" id="inactive" value="0" name="status">
<span>Inactive</span>
<div class="input"></div>
</label>
Does anyone have any ideas on how to do this using the Ember form model binding?
make your labels action, that will allow you to play with them in the controller. I hope this help....
<fieldset>
<label class="option-buttons" for="reason1" {{action "setDeclineReason" "Too Expensive" on="mouseDown"}}>
<input name="decline-reason" id="reason1" value="Too Expensive" type="radio">
<span>
<div class="check"></div>
Too expensive
</span>
</label>
<label class="option-buttons" for="reason2" {{action "setDeclineReason" "Lack of Amenities" on="mouseDown"}}>
<input name="decline-reason" id="reason2" value="Lack of Amenities" type="radio">
<span>
<div class="check"></div>
Lack of amenities
</span>
</label>
</fieldset>
App.DeclineController = Ember.Controller.extend({
declineReason: null,
decline: function(){
var update = this.store.update('request', {
id: this.get('model').id,
user_decline_reason: this.get('declineReason')
});
update.save();
actions:{
setDeclineReason: function(declineReason){
this.set('declineReason', declineReason);
}
}
});
Is it possible to do something like this:
<field:text id="foo" label="Foo Label" model="model.foo" placeholder="foo" />
which would be compiled to:
<div class="control-group">
<label class="control-label" for="foo">Foo Label</label>
<div class="controls">
<input type="text" id="foo" placeholder="foo" ng-model="model.foo">
</div>
</div>
I tried to make a example, but Plunker wouldn't let me save my example... uploaded it to dropbox: https://dl.dropbox.com/u/2862814/plunk.zip
The example breaks with stuff like ng-change. This is due the compilation of the ng-change directive. I tried it with a high priority to the fieldText directive, but doesn't fix it.
You were pretty close with in your example, but you have to put ng-change on the input-field in the template. Your old code:
<field:text ng-change="updateHidden()" ...
Change this to
<field:text change="updateHidden()" ...
and in the directive (see http://docs.angularjs.org/guide/directive - & or &attr - provides a way to execute an expression in the context of the parent scope.)
{scope:{change:'&' ...
and finally the directive template
<input ng-change="change()" ...
Here is a modiefied and working plunkr: http://plnkr.co/edit/QmQjGQQBRtDmkCka0dul?p=preview
<field:text id="too" label="Too" model="model.too" placeholder="too" change="updateHidden()"></field:text>
<script type="text/ng-template" id="/tpl.html">
<div class="control-group">
<label class="control-label" for="{{id}}">{{label}}</label>
<div class="controls">
<input ng-change="change()" type="text" id="{{id}}" placeholder="{{placeholder}}"
ng-model="model">
</div>
</div>
</script>
directive('fieldText',function(){
return {
restrict:'E',
templateUrl:'/tpl.html',
scope:{change:'&',id:'#',model:'=',placeholder:'#',label:'#'}
}
})