textbox Disable on value....


1

116

I am attempting to disable a textbox based on its value at load. There are
actually 3 in question. Only dealing with the one at this time.

<script type="text/javascript">
function disaban()
{
with (document.forms[0])
{
var an = AUDITNO.value

if (an = "-")
{
document.forms[0].AUDITNO.disabled=true;
}
}
}
</script>

David
 
Ad

Advertisements

T

Trevor Lawrence

David,

I could look into this, but I am wondering

If you want the textarea disabled on load, why not just set it in the HTML?
E.G. http://www.w3schools.com/tags/att_textarea_disabled.asp
<textarea rows="3" cols="25" disabled="disabled">
At W3Schools you will find all the Web-building tutorials you need, from
basic HTML to advanced XML, SQL, ASP, and PHP.
</textarea>
 
Ad

Advertisements

J

Jon Spivey

This
if (an = "-")
should be
if (an == "-")
eg
if(document.forms[0].AUDITNO.value=='-')document.forms[0].AUDITNO.disabled=true;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Calendar values to a textbox control 0
Passing textbox string value in a url 3
textbox 1
Textbox 3
reading input values when inputs (textboxes) are in a form 2
Universal textbox 1
3D Textbox 7
TEXTBOX COLOR 1

Top