I have a parameter for a method, it should be a string and how do I & lt;% * .clientID% > To talk about this kind of variable as one of its variables, I can not wrap it in quotes, because it will be taken literally and when I use a variable like the parameter (as you want ) I get ASP error because it is not present in context (
thanks The friends
code sample
function next (currentControl, maxLength, nextControl) {if (document.getElementById (currentControl & lt;% = ClientID% & gt; ..) value.length & gt; = MaxLength) {document.getElementById (nextControl's <% = ClientID%>.) .focus ();} Description is false;} Call sample
wValCode.Attributes.Add ("onkeyup", "Next ('wValCode', '3', ' WValThree ') "); I know that there is probably an ancient way of adding attribute, but I was explained to it. I picked up ASP when I fly, so do not be too hard on me;)
Static HTML
& lt; Input name = "ctl00 $ ContentPlaceHolder2 $ wValThree" type = "text" id = "ctl00_ContentPlaceHolder2_wValThree" style = "width: 33px;" & gt; This is the constant reference that I can find in static HTML. Was it added to one of the ASPs, which contained all J3 files?
Given that you are complying with the key events behind the code, The reference can only be back at the time that you are bound:
wValCode.Attributes.Add ("onkeyup", "next ('' + wValCode.ClientID + '', '3 After that, you already have the passwords passed as parameters for the client javascript function >
function next (currentControl, maxLength, nextControl) {if (document. GetEleme NtById (current control) .value.length & gt; = maxLength) {document.getElementById (next machine). Focus ();} description is false;} one even better Use the option to pass the context of calling object as the first parameter:
// wValCode.Attributes.Add ("onkeyup", "next to the code" (This, '3', '"+ wValThree.ClientID +' '')"); // Javascript function function next (currentControl, maxLength, nextControl) {if (currentControl.value.length> = maxLength) {document.getElementById (nextControl) .focus (); } return false; }
Comments
Post a Comment