By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,847 Members | 2,397 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,847 IT Pros & Developers. It's quick & easy.

how to make a form unselectable?

P: n/a
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

Jun 21 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Garg wrote:
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;};
--
-- kaaposc
"The Knowledge is Power"
Jun 21 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.