0

I want to disable Login time button. When again click on Logout time button that time i want enable the lo-gin button. If page refresh i won't enable login time button(when he already print login time). how can do this through jquery ajax. or Server side. I tried through java script but when i refresh the page again it's going to work.

function submitForm(form) {
    alert("submitted");
}

$('#logintime').click(function(e) {
    this.disabled = true;
});

$('#form').submit(function(e) {
    submitForm(this);    
});

But i need when i click on log Out time then only i want enable the login time button.

Kailash Ahirwar
  • 771
  • 3
  • 14
marvan
  • 31
  • 3
  • 13

1 Answers1

0
$('#logintime').click(function(e) {
  $(this).attr('disabled','disabled');
});
Ankit Agrawal
  • 6,034
  • 6
  • 25
  • 49
  • http://stackoverflow.com/a/5876747/2049063, also jquery docs explicitly state: "The .prop() method should be used to set disabled and checked instead of the .attr() method." – omma2289 Sep 21 '13 at 07:55
  • @Ankit Agrawal yeah of course it's working but when I refresh the div it's going to be work. – marvan Sep 21 '13 at 09:33