ELAYARAJA
ELAYARAJA

Reputation: 521

why readonly not worked in IE 8 and IE 9?

HTML, readonly not worked in IE 8 and IE 9, if any other way to solve,

here is my code,

<input
  size="15"
  type="text"
  name="oldValueMonthlyLimit"
  id="oldValueMonthlyLimit"
  readonly =true
  value="<%=oldValueMonthlyLimit%>">

Upvotes: 0

Views: 16341

Answers (5)

The 'disabled' input elements are used to prevent its value from being submitted.

'readonly' input element doesn't work in IE 8,9, 10 or 11.

In this case, we can use onkeydown="javascript: return false;" for protected (disable) input element and receive its value in the form post data

Upvotes: 1

Foreever
Foreever

Reputation: 7478

Try this:

<input type="text" onfocus="this.blur()" readonly="" >

Also in CSS, put this to make the cursor not change while hovering over the input.

cursor: inherit;

Upvotes: 0

Vucko
Vucko

Reputation: 20844

Use disabled then.

<input
size="15"
type="text"
name="oldValueMonthlyLimit"
id="oldValueMonthlyLimit"
disabled value="text" >

Link

See also this: Example

Upvotes: 2

mcalex
mcalex

Reputation: 6788

From w3schools:

<input readonly="readonly">

Note: The readonly attribute is a boolean attribute, and can be set in the following ways:

<input readonly>
<input readonly="readonly">
<input readonly="">

Upvotes: 0

Amadan
Amadan

Reputation: 198408

Have you tried readonly="readonly"?

Upvotes: 1

Related Questions