Hi there...Have a simple question, but dont really know how simple the answer is
My site works perfectly on Mozzila and has a problem with IE no matter the version.
I have a text box that is disabled in the beggining. In Mozzila when the page loads that textbox is grey.
<input type="text" name="textbox1" size="20" disabled = false>
When a particular radio button is pressed a Javascript function is called and it becomes enabled.
<a href = "javascript:enableRentPrice()"><input type="radio" value="V1" checked name="R1"></a>
The function
function enableTextBox(){
document.forms['form1'].elements['textbox1'].disabled = false;
}
When opening the page with Internet Explorer
A) The text box is not grey
B) The text box doesnt get clicked and doesnt get any text
C) The function doesnt change anything
Might be smth trivial...Any ideas plz?
works on mozzila, doesnt work on IE
Moderator: General Moderators
why don't you make it a checkbox instead of a radio button. Also, you cant really put a checkbox or radio in a <a> tag like that. It might work, but it's definitely not conventional. Instead use an onClick event of the checkbox.
like this:
like this:
Code: Select all
<script>
function enable(obj)
{
if(obj.checked)
document.forms[0].textfield.disabled = false;
else
document.forms[0].textfield.disabled = true;
}
</script>
<form>
<input type="text" name="textfield" disabled="disabled"><input type="checkbox" name="someCheck" onClick="enable(this)">
</form>
I need radio buttons cause there are other choices as well and only one must be selected.Thats not the issue
The thing is that when the page loads the textbox is not grey as in mozzila and its clickable...There is another textbox with the disabled attribute set to false and its not clickable as well...So maybe there is an issue with the disabled??...or maybe its the inclusion of the radio button on the <a></a>
I'll try to change that and see what happens.Its the second time im told off for that weird technique so i'll pass and change it...
Will let you know
The thing is that when the page loads the textbox is not grey as in mozzila and its clickable...There is another textbox with the disabled attribute set to false and its not clickable as well...So maybe there is an issue with the disabled??...or maybe its the inclusion of the radio button on the <a></a>
I'll try to change that and see what happens.Its the second time im told off for that weird technique so i'll pass and change it...
Will let you know
Cool...ok.things are wokring nicely for IE after i removed the <a></a>
One little difference is that the disabled textbox is grey on Mozzila when in IE its still normal looking, but just not clickable...
Is there any way to make it look in IE as it looks in Mozzila?
Thanks anyway, at least its working!
One little difference is that the disabled textbox is grey on Mozzila when in IE its still normal looking, but just not clickable...
Is there any way to make it look in IE as it looks in Mozzila?
Thanks anyway, at least its working!
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
as a matter of proper syntax, the disabled property is assigned like this:
and
Cheers,
Kieran
Code: Select all
<input type="text" name="textbox1" size="20" disabled="disabled" />Code: Select all
<input type="text" name="textbox1" size="20" disabled="false" />Kieran