PayPal Variables Add ref number - variables

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.

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>

How do I get Python selenium to select a particular input when there are multiple inputs with identical names?

I am coding a unittest to automate the selection of a particular time slot from a website.
The HTML code contains multiple inputs corresponding to different days and all these inputs have the same name. Currently I have only managed to select the "Book" button for the next available day. How do I select the "Book" button for a later day.
This is the HTML code. Each input is part of a separate form.
<form method="POST" action="/bookings1/Book.php?CWID=1388&intCompID=123790">
<input type="submit" name="Book" value=" Book">
This is the Python code I have used which succeeds in selecting the first input.
driver.find_element_by_xpath("//input[#name='Book']").click()
How should I proceed to select subsequent inputs?
Thank you in advance

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.

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

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

Unable to import data from excel for drop-down list

Here is the code below,
driver.findElement(By.id("ctl00_ContentPlaceHolder1_cbpAssociationNew_panelAssnDetailAdd_Industry_B-1")).click();
driver.findElement(By.id("ctl00_ContentPlaceHolder1_cbpAssociationNew_panelAssnDetailAdd_Industry_I")).sendKeys(sh.getCell(2, 2).getContents());
i have tried out the below code still not working:
Select sel= new Select(driver. id( "ctl00_ContentPlaceHolder1_cbpAssociationNew_panelAssnDetailAdd_Industry_B-1" ));
sel.SelectByVisibleText(sh.getCell(2, 2).getContents());
For text field type it's working fine. Only for List fields it's not importing.
HTML CODE BELOW:-
<input type="text" style="color:#555555;font-family:Arial,Helvetica,sans-serif;cursor:default;" readonly="readonly" onkeypress="aspxEKeyPress('ctl00_ContentPlaceHolder1_cbpAssociationNew_panelAssnDetailAdd_Industry', event)" onfocus="aspxEGotFocus('ctl00_ContentPlaceHolder1_cbpAssociationNew_panelAssnDetailAdd_Industry')" onblur="aspxELostFocus('ctl00_ContentPlaceHolder1_cbpAssociationNew_panelAssnDetailAdd_Industry')" onchange="aspxETextChanged('ctl00_ContentPlaceHolder1_cbpAssociationNew_panelAssnDetailAdd_Industry')" id="ctl00_ContentPlaceHolder1_cbpAssociationNew_panelAssnDetailAdd_Industry_I" value="--Select--" name="ctl00$ContentPlaceHolder1$cbpAssociationNew$panelAssnDetailAdd$Industry" class="dxeEditArea dxeEditAreaSys " autocomplete="off">
HTML LINK:-
https://docs.google.com/document/d/1fZ-YuuYXlrJzFbRJ_oPOMycdMlloS66dPIYe6TJDfas/edit?usp=sharing
From what I can see from the HTML code snippet, this is not a simple Select dropdown that can be worked out using Select class. It consists of tables and table elements.
So, to resolve this you've to do things:
1- Click on the dropdown table using the below code:
driver.findElement(By.id("ctl00_ContentPlaceHolder1_cbpAssociationNew_panelAssnDetailAdd_Industry_I")).click();
2- Click on the dropdown item that matches the text so fetched from the sheet using below:
driver.findElement(By.xpath("//td[#class='dxeListBoxItem' and contains(text(),'"+sh.getCell(2,2).getContents()+"')]")).click();;
OR try using "Action class":-
1- Click on the dropdown table using the below code:
Actions act = new Actions(driver);
act.moveToElement(driver.findElement(By.id("ctl00_ContentPlaceHolder1_cbpAssociationNew_panelAssnDetailAdd_Industry_I"))).click().perform();
2- Click on the dropdown item that matches the text so fetched from the sheet using below:
act.moveToElement(driver.findElement(By.xpath("//td[#class='dxeListBoxItem' and contains(text(),'"+sh.getCell(2,2).getContents()+"')]"))).click().perform();