I have a “selection box” on my page, and I don’t want the user to select any option, but the first one (please do not ask me why). I cannot change for "input" with the attribute "readonly", and I cannot delete the parameters. I'm sorry for the limitations, but it should be so.
I tried this:
$('select').attr('disabled',true);
But it happens that I do not want to "lose" the meaning. I have an ajax call that uses these values, and when I turn it off, the value "doesn't exist" anymore.
I also tried:
$('select').click(function(){
return false;
});
But without success.
source
share