Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 27th, 2006, 12:40 PM
Registered User
 
Join Date: Jun 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Javascript changes to Textbox Control

Hi:

I have a javascript that I have attached to the onblur of an asp.net textbox to encrypt passwords. The script runs and when I examine the output of the script the password has been encrypted, however it doesn't seem to be updating the Textbox.Text. Here is my code:

//inVal is control name passed by Me.ClientID() on page load
function hashPass(inVal){

        //alert(inVal);
        var passVal = inVal.value;
        //alert(passVal);
        var newPassVal = hex_md5(passVal);
        //alert(newPassVal);
        inVal = newPassVal;

        alert(document.forms[0].Login1_txtPass.Value);

    }

Sub Page_Load

If Not IsPostBack() Then
  Dim command as String = "return hashpass(" + Me.ClientID() + "_txtPass);"
  txtPass.Attributes("onBlur") = command

When I examine the value of the Textbox.Text after postback it has the unecrypted value, what is going on here?



 
Old June 28th, 2006, 01:05 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

You're not assining the new value(newPassVal) to the textbox

 
Old June 28th, 2006, 01:14 PM
Registered User
 
Join Date: Jun 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanx. I did figure this out finally. I misunderstood the need to specify inVal.value = newPassVal rather than inVal = newPassVal. It all works happily now.
:)






Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript to validate a textbox abhishekkashyap27 Javascript 9 May 6th, 2008 02:41 AM
Textbox Validations using javascript jithendar84 ASP.NET 1.0 and 1.1 Basics 2 January 18th, 2008 03:12 PM
textbox value using javascript on user control k.manisha ASP.NET 1.0 and 1.1 Professional 1 February 12th, 2007 04:48 PM
hi help me to write javascript to validate textbox karthikc85 XML 1 October 12th, 2006 03:12 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.