how to make a form unselectable?

G

Garg

Hi All,

I am facing a technical problem. I have craeated one form and in that
I have a table. in that table user can select a row and by using shift
key user can select multiple rows. this i did by changing the
background color. this works fine.

But if a user selectes one row in table and then click somewhere else
in the form with shift key. Then form get selected. I make every div
and cell in the table to be unselectable by "unselectable='on'". but
this is not woking.

what to do to make the form unselectable.

Thanks
Tarun Garg
 
K

kaaposc

Garg said:
Hi All,

I am facing a technical problem. I have craeated one form and in that
I have a table. in that table user can select a row and by using shift
key user can select multiple rows. this i did by changing the
background color. this works fine.

But if a user selectes one row in table and then click somewhere else
in the form with shift key. Then form get selected. I make every div
and cell in the table to be unselectable by "unselectable='on'". but
this is not woking.

what to do to make the form unselectable.

try this:

// put here your form's id
var myForm = document.getElementById("formId");
// this one is for IE
myForm.onselectstart = function(){return false;};
// these are for FF and Opera
myForm.onmousedown = function(){return false;};
myForm.onclick = function(){return 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

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top