Hello Everybody,

I am new to javascript programming.
I want some help regarding this.
I want a javascript code in which it should disable fields automatically when we onload a page.

Recommended Answers

All 2 Replies

Use onload event. Call a function when the body loads. In that function, disable all those textboxes you want to disable.

there is an easy and fast way to do that :

<script>
window.onload=function()
{ document.getElementById("yourformID").disabled = true;
}

Serkan Şendur

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.