Strikethrough text in Select Option - html

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

Related

Highlight the newly added row in clr-datagrid

I have used clarity UI in my project and i have come across an issue where i want to select the row which is currently added to the clr-datagrid table .I've used clr-DgSelected directive and it gives me a select checkbox which i don't need and if i use [(clrDgSingleSelected)]="selectedUser" this will give me a radio option and it lets me to select the particular column with the radio option checked but the problem is not the radio button or checkbox i just want to highlight the newly added row how i can achieve this.
Any help would be appreciated Thank You
Since Clarity doesn't have the concept of a newly added row, you need to add that concept yourself. Each record could have a isNew or showHighlight property that would allow you to add a CSS class that will highlight it
<clr-dg-row *ngFor="let user of users" [class.highlight]="user.isNew">
<clr-dg-cell>{{user.id}}</clr-dg-cell>
<clr-dg-cell>{{user.name}}</clr-dg-cell>
<clr-dg-cell>{{user.creation | date}}</clr-dg-cell>
<clr-dg-cell>{{user.color}}</clr-dg-cell>
</clr-dg-row>

Select checkbox on website using VBA

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"

Primefaces Select Many

Is there any way to use the select many component with an input text inside, in order to be able to both select an option and specify a number of instances of it.
Any idea please?
http://www.primefaces.org/showcase/ui/data/pickList.xhtml
This is what you are looking for~!

How can we limit # of visible items in drop-down select tag in a form?

I have the following code which works fine, but i want to limit the number of stores to say 10. So i added a 'size="10" ' attribute to the select tag, but the drop down stops functioning.. Please help!!!
<form:select size="10" path="storeid" style="width:200px;" >
<form:options items="${StoreList}" itemValue="storeId"
itemLabel="storeName" />
</form:select>
thanks in advance!!
You can't control how many items are visible in the dropdown list.
In fact you can't even know that the select element is shown as a dropdown list at all. If you browse to the page on a mobile phone for example, you will get a completely different way of selecting items, usually a list that covers most or all of the screen.
The HTML standard doesn't dictate how the select element is to be shown, so it's entirely up to the browser vendors to choose what they think is the best way to show it.

"A, B or none" input for HTML forms

I have a case where I want to allow a form variable to be set to one of a set of value (in my current case true/false) or left unset (in which case no value is returned rather than some 'none' value or a blank). A check box can give the unset bit but only one set value. A radio element could work, sort of. But once a value is selected there is no way to go back to unset. All the other inputs I've looked at always set the variable no matter what.
Am I missing something or am I just going to have to accept a less-than-ideal solution?
Three radio buttons or a <select> with three <option> will do.
Put three radios: A, B and None
Do a 'drop down menu' as show here: http://www.echoecho.com/htmlforms11.htm
Create the default value as 'None' followed by option A and then option B.
What about a drop down list with
---Please Select---
Option A
Option B
I've been applying to a lot of jobs online lately, and this is the route people generally have been taking.
Would a dropdown box work?
<select name="choices">
<option>(None)</option>
<option value="a">Choice A</option>
<option value="b">Choice B</option>
</select>
You would need to use some javascript. If you have jQuery there are several tri-state checkbox plugins.
For example: http://plugins.jquery.com/project/tristate-checkbox
There are also probably non jQuery scripts if you google for "tri state checkbox"
For example: http://caih.org/open-source-software/tri-state-checkbox-in-javascript/
Using 3 radio buttons in one group, you could hide the first 'none' radio button with CSS (visibility:hidden; or display:none;), and if that's the one still selected during your form validation, then the user hasn't chosen either of the true or false radios.
EDIT (post comments):
If no-Javascript is a requirement, then you can conditionally apply a 'hideableItem' class on the hidden radio, if scripting is disabled the worst you'll get is 3 radio for the user to choose from, as others have described. If JS is enabled, then the default radio is hidden and provides the behaviour i've described.
The conditional hiding if JS is dis/enabled technique is described here: http://lucassmith.name/2008/10/script-to-add-css-only-when-javascript-is-available.html
I use it all the time, its great.