Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show value of a texbox when a button is pressed.

Status
Not open for further replies.

WildWest

Programmer
Apr 2, 2002
111
US
This should be simple for a javascript guru out there. Could someone please show me how to show the value of a textbox when a button is pressed? I'm trying the following... and I think I'm almost there. Thx in advance, Bill

<script language="JavaScript">
function passwordReminder(strName){
if (confirm("An email will be sent to your email account on file." +"\nClick OK to continue and get your password!")){
window.location="index.cfm?reminder=" +escape(strName)+"";
}
}
</script>

<form action="index.cfm" method="post" name="loginform">
<input class="txtmen2" type="text" name="username" size="20">
<input name="Forgot" type="button" class="txtmen2" value="Forgot" onClick="reminder('test')">

</form>
 
Code:
<script language="JavaScript">
    function passwordReminder(strName){
        if (confirm("An email will be sent to your email account on file." +"\nClick OK to continue and get your password!")){
            window.location="index.cfm?reminder=" +escape(strName)+"";
        }
    }
</script>

<form action="index.cfm" method="post" name="loginform">
<input class="txtmen2" type="text" name="username" size="20">
<input name="Forgot" type="button" class="txtmen2" value="Forgot" onClick="reminder([highlight]document.loginform.username.value[/highlight])">

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook

zen.gif

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top