0

i have a problem with an input that sets automatically the name attribute witch blocks a javascript code traitement, this is the input code before running it:

<asp:textbox ID="replace" runat="server" Name="passchk_pass" type="Password" Size="40"/>

and this is how it becomes after running:

<input name="ct$Main$ct$Tab$Edu$replace" id="Main_ct_Tab_Edu_replace" type="Password" size="40">

so im losing the name that i sets befor in order to get a js traitement, how can i stop the input to set automatically the name attribute?

VDWWD
  • 35,079
  • 22
  • 62
  • 79
anass 90
  • 125
  • 1
  • 2
  • 14

1 Answers1

0

Better access the TextBox by ID. You can use a static client ID mode for that.

<asp:textbox ID="replace" ClientIDMode="Static" runat="server" Name="passchk_pass" type="Password" Size="40"/>

This is not recommended however, since it can lead to duplicate ID's. Better is to make sure javascript get's the correct ID.

var textBoxId = "<%= replace.ClientID %>";

But if you really want to use the name to access the TextBox you can use UniqueID

var textBoxName = "<%= replace.UniqueID %>";
VDWWD
  • 35,079
  • 22
  • 62
  • 79
  • the clientIDMode= "static" helped me with the issue because i changed some thing in the js library. 10'x – anass 90 Nov 24 '16 at 10:54