trigger (ngOnChange) by code to bind the changed model value - angular2-template

I have an input field that takes a date and use pipe to change the output accordingly and with that I am using
(ngOnChange)="myvalye=myFunction($event)"
to update the value. now I have a button whose onclick i want to reset all the data. Below is the code for refrence.
<mydatepicker [ngModel]="mydate | datepipe" (ngModelChange)="mydate=myFun()"/></mydatepicker>
<button class="btn btn-default" (click)="reset()">Reset</button>
so on click of reset button myValue is not getting changed in input box.
datepicker library can be found here

Related

Disable of submit button based on 3 fields(2 input fields and one checkbox) validation

I am trying to enable the submit button if user enters the Password field, the confirm Password field and checks the terms and conditions checkbox, if any of these field is blank, the submit button should get disabled.
For me the button is only getting enabled if user provides all of the above fields, but once it is enabled, the button is not getting disabled if user removes any of the field values and make it blank.
Can someone Please help ?
<div>
<wb-button v-bind:disabled="disableSubmitButton" v-if="showFinalSubmit" v-on:click="validatePassword" type="submit" size="m" variant="primary">
{{ t("submit") }}
</wb-button>
<div>

PayPal Variables Add ref number

I'm struggling to add a variable to my PayPal payment form I need users to add a ref number so that I can identify the order so for example,
I normally use the email link option rather than the form option
Add Ref No :
Add Personal Message :
any help would so much appreciated
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="HUMXQRA7T9Z3L">
<input type="image" src="https://www.paypalobjects.com/en_US/GB/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal – The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</form>
You're using a hosted button, so edit the button at www.paypal.com/buttons , view your saved buttons , find your button and edit it using the action menu.
In the Customize Button box, check the option to add a text field, and save your changes. This will generate new code to copy.
The hosted editor will only generate one text field, so if you need a button with more you'll need to create a new button with the first text field, and in step 2 uncheck the option to save the button at PayPal. When the code is created, click to remove the code protection. This will result in an unhosted button. Copy it to a text editor, and you can then extend the single text field to be two text fields, incrementing the ID number from e.g. 0 to 1 as is necessary for the second field.
You can read about HTML variables for PayPal buttons.

How to send an event to a element in a relative position of the current element

I have a list of elements with the class .node-display, when one is clicked it becomes an input. I want to capture the down or up arrow keyups to click the very next .node-display in the list (relative to the current element).
In the below example, pressing down should click on item 5, and pressing up would click on item 3.
1
2
3
4 (Currently selected)
5
6
My best guess is something like this.
<input
_="on keyup[key is 'ArrowDown'] send click to the first .node-display end"
>
Does anyone know how I'd actually write this expression?
You probably want to put the behavior on the parent ul so you don't have to repeat it on every input.
Something like this:
<ul _="on keydown[key is 'ArrowDown'] from <input/> in me
set nextSibling to it's parentElement's nextElementSibling
if nextSibling
set nextInput to the first <input/> in nextSibling
call nextInput.focus()
halt
end
on keydown[key is 'ArrowUp'] from <input/> in me
set previousSibiling to it's parentElement's previousElementSibling
if previousSibiling
set previousInput to first <input/> in previousSibiling
call previousInput.focus()
halt
end
">
<li><input/></li>
<li><input/></li>
<li><input/></li>
<li><input/></li>
</ul>
Some notes on this code:
I am using the from from in the event handler, which puts the element that the event came from into the it symbol
I am using the keydown event so we can cancel the event with the halt command, to avoid the down and up keys changing the caret position
I am using the halt command to stop the event from propogating
I used focus rather than click as a proof of concept

Why the field in webbrowser is still consider as empty even I already set its value?

enter image description hereI'm trying to automate our ticketing system using visual basic. However, I can't save the profile because the field in webbrowser is still read as empty even I already set its value:
I also tried to set the attribute originalvalue, prekeyvalue etc. but still not working. But if you manual type the value in the field, it will work.
My code below:
WebBrowser1.Document.GetElementById("mb8a86d99-tb").SetAttribute("value", "EMAIL")
The information of field below:
<input datatype="0" id="mb8a86d99-tb" aria-required="true" role="textbox" aria-labelledby="mb8a86d99-lb" class="fld text fld fld_req" ctype="textbox" li="mb8a86d99-img" maxlength="512" style=";width:225.0px;" async="1" ae="setvalue" type="text" value="" ov="" work="1" fldinfo="{"lookup":"valuelist","dsid":"TSDTKTSOURCE","inttype":"0","afindex":"0","length":"512","required":true}" title="" originalvalue="" prekeyvalue="" stoptcclick="true">
This kind of problem seems to occur in some web pages when the form containing your input does not get activated (it's a form of protection on client-side made to avoid the insertion of values programmatically).
If you manually type the value in it, the form turns active because you're clicking on the input which is a child of the form. However, if you do it programmatically, the activation is not triggered and so the value that you add to the HTML is not taken by the client.
You can try to emulate the activation of the form with the Focus method on your input:
WebBrowser1.Document.GetElementById("mb8a86d99-tb").Focus
WebBrowser1.Document.GetElementById("mb8a86d99-tb").SetAttribute("value", "EMAIL")
If that still doesn't work, try to add a Application.Wait(TimeSerial(Hour(Now()), Minute(Now()), Second(Now()) + 2)) between one command and the other to let the form the time to actually activate itself.

How to use a confirmation dialog box in Odoo?

I'd like to get a value in a confirmation dialog bow in odoo.
I have a form with a select. When I choose a value in the select and click the save button, I have a diablog box with a message. In this message I'd like to get the selected value.
Any idea ?
<button string="save"
icon="gtk-ok"
type="object"
name="update_year"
confirm="The selected year is XXXX. Confirm ?"/>