* Login   * Register


Last visit was:
It is currently Tue Feb 20, 2018 10:51 pm
View unanswered posts
View active topics





Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Cách enabled các control bằng JavaScript
PostPosted: Sun May 31, 2009 2:59 pm 
Offline

Joined: Thu Feb 05, 2009 11:45 am
Posts: 11
---------
Các bạn có thể dùng qua thuộc tính disabled của mỗi Element trong HTML cái này có giá trị là True/False.

<script language="javascript" type="text/javascript">
var MySite = {
Validate: function() {
var cb1 = document.getElementById("cb1");
var btn1 = document.getElementById("btn1");
if (cb1.checked) {
btn1.disabled = true;
} else {
btn1.disabled = false;
}
}
}
</script>

<input type="checkbox" name="cb1" id="cb1" value="1" onclick="javascript:MySite.Validate();" />
<input type="button" name="btn1" id="btn1" value="Submit" />


Report this post
Top
 Profile E-mail  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 


Who is online

Users browsing this forum: No registered users and 0 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron

Free Forums · php-BB© · Internationalization Project · Report abuse · Terms Of Use/Privacy Policy
© Forums-Free.com 2009