How to show ToolTip for disabled TextBox in JavaScript

Posted by Muralidosscm under ASP.NET on 7/6/2012 | Points: 10 | Views : 8894 | Status : [Member] | Replies : 13
How to show ToolTip for disabled TextBox in JavaScript

Regards
Muralidoss M



Responses

Posted by: Muralidosscm on: 7/6/2012 [Member] Starter | Points: 25

Up
0
Down
Urgent Help me

Regards
Muralidoss M

Muralidosscm, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Anu.Malik on: 7/6/2012 [Member] Starter | Points: 25

Up
0
Down
Hi ,

Use 'title' for tooltip.Below the sample code use like that.

<script type="text/javascript">
function myFunction(){
document.getElementById('txt1').disabled = true;
document.getElementById('txt1').title = 'ToolTip';
}
</script>

<input type="text" id="txt1" />
<input type="button" value="Click Me" onclick="javascript:myFunction();" />

Thanks & Regards ,
Anu Malik

Muralidosscm, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Muralidosscm on: 7/6/2012 [Member] Starter | Points: 25

Up
0
Down
thank u Anu.malik

But i want to call onmouseOver event

Regards
Muralidoss M

Muralidosscm, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Anu.Malik on: 7/6/2012 [Member] Starter | Points: 25

Up
0
Down
If You want tool tip on mouseover of text box then use like that.

<input type="text" id="txt1" onmouseover="javascript:myFunction();"/>

What is actual requirement.............

Thanks & Regards ,
Anu Malik

Muralidosscm, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Muralidosscm on: 7/6/2012 [Member] Starter | Points: 25

Up
0
Down
Actually i have lot off disabled textboxes in gridview and i have set Onmouseover Tooltip message on pageload event
so can't able call the javascript function during the disabled condition.

But, enabled textbox tooltip working fine.........



Regards
Muralidoss M

Muralidosscm, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Anu.Malik on: 7/6/2012 [Member] Starter | Points: 25

Up
0
Down
Plaese attach ur code

Thanks & Regards ,
Anu Malik

Muralidosscm, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ajay.Kalol on: 7/6/2012 [Member] Starter | Points: 25

Up
0
Down
Sorry, You Can't do anything on disabled button.
But Another way is this. you can put DIV tag as parent tag of button and display tooltip on DIV's mouseover event

Ajay
ajaypatelfromsanthal.blogspot.in

Muralidosscm, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Muralidosscm on: 7/6/2012 [Member] Starter | Points: 25

Up
0
Down
urgent guys plz replay fast................................

Regards
Muralidoss M

Muralidosscm, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Anu.Malik on: 7/6/2012 [Member] Starter | Points: 25

Up
0
Down
Please Share ur code with us

Thanks & Regards ,
Anu Malik

Muralidosscm, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Muralidosscm on: 7/6/2012 [Member] Starter | Points: 25

Up
0
Down
sc------------------------------------------

Regards
Muralidoss M

Muralidosscm, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Anu.Malik on: 7/6/2012 [Member] Starter | Points: 25

Up
0
Down
Hii,

You can use ReadOnly Property Instead of Enabled Property

Thanks & Regards ,
Anu Malik

Muralidosscm, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Muralidosscm on: 7/6/2012 [Member] Starter | Points: 25

Up
0
Down
instead of readonly......

if i click the textbox mean the popup will open that is the pblm for me............



Regards
Muralidoss M

Muralidosscm, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Anu.Malik on: 7/6/2012 [Member] Starter | Points: 25

Up
0
Down
Hi

You can do one thing. Set Readonly Property and On Open Popup Check txtBox is readonly or not Like this.
This is the sample code

function ToolTip(textid, todayDay, seleteddate) {

document.getElementById(textid).title = "Hii";

if (document.getElementById(textid).readOnly == false) {

window.open("task.aspx");
}
}


<asp:TextBox ID="txtDays" ReadOnly="true" runat="server"></asp:TextBox>

Thanks & Regards ,
Anu Malik

Muralidosscm, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response