I have an piece of VBA-code, to log in to a website.
This was quite easy, looking for the ID of the element, and use the code:
IE.document.getElementById("Postponement").Click
But now I get a problem, because the HTML code of a particular checkbox is only:
<input type="checkbox" data-bind="checked: selectAll, click: actionAllSelected"></input>
This is a checkbox to select all customers on this particular page. I want to select them all. Because there is no ID or NAME, I can not use getElementById.
Here is the checkbox, and the HTML code. If you want more information then let me know!
Anyone have an idea to select this checkbox with VBA?
try IE.document.getElementsByAttribute("Type")(0).checked="1"
Related
I notice that the date input works differently from the other inputs.
I would like to know if it is possible to have different colors inside the date input.
To illustrate, I would like that when nothing is written inside:
And have this when we are typing the date:
I'm developing with Angular, I have not done HTMLElement, but I can in need.
Here is my code:
https://stackblitz.com/edit/angular-scss-demo-pusdk7
Is it possible to get something like that?
Can you please try this:
<input type="date"
name="Birth date"
[formControlName]="BIRTH_DATE"
/>
Does anyone know how to create a form select, where the front-end text that appears in the options has a strikethrough? We want to show how prices are being discounted for a sale, so want to be able to basically do:
<option value="10"><strike>$15</strike> $10</option>
Thanks in advance for any help!
You can't give any css formatting to that option tag. Usually, when you want a different style in the selector options you need to create your own select with css and js.
Here you have a reference:
https://www.w3schools.com/howto/howto_custom_select.asp
I have an HTML form that sends a food dish. For example,
placeorder.com/order.php?id=STEAK
I want to add another value and send
placeorder.com/order.php?category=MEAT&id=STEAK
But, I don't want the user to have to select meat anywhere, since this has been already decided.
I tried to tinker with the form target and include it from there, but it didn't work.
Is there some "hidden text box" to write the category to so that it gets posted, or is there another way to do it?
Thanks in advance!
First, I just thought I'd mention that it's funny how the questions is phrased since you pretty much answered your own question:
Is there some "hidden text box"
Anyway, yes:
You can use type='hidden'
I assume that you are already using a GET form so I will just include the input part:
<input name='category' type='hidden' value='MEAT'>
I want to find out the ID of an element. I want to find out the ID of the textbox because I need the ID to type into my VB application (from there I will use GetElementbyID to find the element). I tried "futPhishingTextBoxTyped" for the ID but it doesn't work..
The Textbox with the class of "futPhishingTextboxTyped" does not have an assigned ID. You need to refer to it from the FORM parent:
document.*formname*.futPhishingTextboxTyped (whatever your form name is)
INPUTS are also supposed to be self-closing:
<input class="futPhishingTextboxTyped" type="text" maxlength="15" />
It doesn't have an id. You could try getting the div and then finding children of it that are inputs with
GetElementById("futPhishingAdditional").GetElementsByTagName("input")
Going by your comment, the full line might look like this:
WebBrowser1.Document.GetElementById("futPhishingAdditional").GetElementsByTagName("input").Item(0).SetAttribute("value", TextBox1.Text)
i using js to add multiple row in a particular table, but when submit the form all check box having the same value, so how can i validate this checkbox using js before submit so change value to if unchecked, i trying on that but got no solution, does any one this before,
thanks in advance
What are your checkboxes called? Do they all have the same name? You have two options. One is giving each checkbox an unique name, the other is giving your checkbox a name like checkboxes[]. The [] lets all the values be entered into an array so they don't overwrite eachother.
If you mean something else, you have to state more clear what you want, because it's a bit incomprehensible right now.
finally i found solution for my problem, thanks 'vindia' for the clue, i add checkbox with array, sol as below
in html
`<input id="abc[]" name="abc[]" type="checkbox" value="1">`
in js
for(var i=0;i<chkDefaultLength;i++){
if(!document.neworupdateevent["chkDefault[]"][i].checked){
document.neworupdateevent["chkDefault[]"][i].value=0;
}
}