highlighting the textbox without using javascript or jquery - html

can we highlight our textbox without using javasript/jquery or css ?if yes then how? i am on jsp page, can jsp help?

You can do it with CSS inline, without using an external stylesheet. If you really must:
<input type="text" style="background-color:#FFFFCC;" />

To change the default style (including color) of an HTML element from the default style that the browser uses, you must apply the style via CSS or JavaScript.

No, that is not possible without CSS (if you want to use things like colors). You can do it without JavaScript, though. This would be the CSS for doing it:
.textbox {
background-color: #FF0000;
}
And the markup:
<textarea class="textbox" rows="10" cols="30"></textarea>

Related

How to style a button on disabled state using inline CSS only

I have a button and I want to style it when disabled using inline style only.
I know how to style using internal/external style.
Code below:
<input type="submit" value="Submit" disabled="disabled" />
Other than by explicitly changing the style with JavaScript (which violates your "inline CSS only" constraint): you can't.
The style attribute only contains the body of a rule-set. It can't do anything that you need a selector for.

Can i eliminate down button on <datalist> tag?

<datalist> is an HTML5 tag which is use in order to order elements and choose them. when i use it with <input>, it gives me this.
i dont want to see list items like that before i typed it on, so can i eliminate this down button on it. is there an attribute for this?
ALSO can i use it other tags than <input>
NO is not an answer for this question!
To remove the down arrow, try using the following in your CSS:
input::-webkit-calendar-picker-indicator {
display: none;
}
Example http://jsfiddle.net/5UYdy/
Unfortunately, there is no selector which does it.
BUT!
You can add required attribute to the <input> tag. Then, we can access this input by CSS3 tags:
input:valid - when input has content
input:invalid - when input is blank
Adding following style:
input:invalid::-webkit-calendar-picker-indicator {
display: none;
}
will show the list only when the input is not empty.
The following JSFiddle shows that in action, hope it helps:
http://jsfiddle.net/5UYdy/2/
The only disadvantage is that the input is required.
And no, you can't use it with other elements, according to W3Schools
The tag specifies a list of pre-defined options for an element.
This will remove history of an input box but...,
<input type="text" autocomplete="off"/>
but I think there is no way to remove <datalist>
your best bet is this:
input::-webkit-calendar-picker-indicator {
opacity: 0;
}
<div class="form-field__control">
<input
type="text"
list="currency"
id="currency"
/>
<datalist id="currency">
<option>Dollars</option>
<option>Pounds</option>
<option>Naira</option>
<option>Peso</option>
</datalist>
</div>

Html Checkbox Disabled State is Difficult to Read

I have a checkbox created as follows:
<td class="center">#Html.DisplayFor(modelItem => item.IsBusinessHours)</td>
It renders as the following html:
<input disabled="disabled" class="check-box" type="checkbox" CHECKED="checked"/>
My problem is that the check in the box is very hard to read in this disabled state.
I would like to know the best way to style the checkbox to make it appear like the non-disabled checkbox (or otherwise make it more readable). However I still want the checkbox to be read only.
My project uses Asp.Net MVC, jQuery and jQuery-UI.
you can add rules like this to you CSS style sheet :
input[disabled='disabled'] {
color: #ccc;
}
but ie6 doesnt support that, just a heads up.
I ended up resolving this issue by replacing my checkboxes with jQuery UI buttons. The jQuery script that I ended up using is posted here.

How to create a textbox watermark?

I wish to create a textbox watermark without using either Ajax or JavaScript. How can I do this?
It is very easy.
In html we can give the placeholder attribute for input elements.
e.g.
<input type="text" name="fst_name" placeholder="First Name"/>
check for more details :http://www.w3schools.com/tags/att_input_placeholder.asp
You can assign a background image with CSS like so.
textarea {
background-image: url(yourwatermarkimage);
background-attachment: scroll;
}
I have got a dll on this site. It solved my problem
http://www.dotnetcurry.com/ASPNETandjQuery/Section1-TextBox/R12-TextBoxWaterMark.aspx

CSS HTML form "file" customize

Can someone teach me or give me a link for my problem?
I wanted to customize my form "file" --> for uploading.
How can I customize it?
.classfile {
css codes....
}
<input type="file" name="name" class="classfile" />
If I do that way the text box and button of form will be affected. What is the other way to customize that?
You can't style a
<input type="file">
Just with CSS. Take a look here for a great trick : http://www.quirksmode.org/dom/inputfile.html
The short answer: You can't and you shouldn't. This is done purposely, to stop tricking people with this security/privacy critical element.