Link to home
Start Free TrialLog in
Avatar of UFCWIT
UFCWIT

asked on

javascript title property for tooltip

Hi,

In a javascript function I am trying to set a tooltip, via the title attribute (see below)

  var fzip = document.getElementById('txtforeign');
  fzip.title = 'Foreign'

the txtforeign textbox is defined in my aspx as the following:
<asp:textbox ID="txtforeign" style="Z-INDEX: 139; LEFT: 502px; POSITION: absolute; TOP: 97px" MaxLength="10" Width="75" Visible="true" runat="server"></asp:TextBox>

my problem is in the codebehind in vb.net on a btnsubmit click event, I want to try to access the tooltip property for the textbox txtforeign that I just set in javascript but it is coming back a "" in the codebehind even though it will show 'Foreign' on the mouseover when I have the page up and I can't figure out for the life of me what I am doing wrong here.

Thanks


Avatar of Zvonko
Zvonko
Flag of North Macedonia image

CodeBehind on Server does not see what the browser script has done.
The new set attributes are only present in browser and NOT on server side.

Avatar of UFCWIT
UFCWIT

ASKER

Thanks Zvonko,

Is there anyway properties that I can share between client and server, I need to be able to access a property that I can set between client and server to determine something on the button submit.

save the title in a hidden field :

<asp:Hidden ID="txtforeign_tooltip_value" runat="server"></asp:Hidden>

var fzip = document.getElementById('txtforeign');
fzip.title = 'Foreign';
document.getElement("<%= txtforeign_tooltip_value.ClientID %>").value = 'Foreign';
ASKER CERTIFIED SOLUTION
Avatar of Zvonko
Zvonko
Flag of North Macedonia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial