ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old April 15th, 2006, 01:59 PM
accessman2 accessman2 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2006
Posts: 11 accessman2 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 46 m 21 sec
Reputation Power: 0
Keep the values when it redirect the same page

Hi,

I have a question.

I made the create the new user form.

<script language="javascript">

function submitFrm()
{
document.submitform.action="complete.asp"
document.submitform.submit();
}
function Validate()
{
var username = document.submitform.username.value;
var password = document.submitform.password.value;
var email = document.submitform.email.value;
var str = ""

if (username=="")
{str="Username";}
if (password=="")
{str=str + "\nPassword";}
if (email=="")
{str=str + "\nE-Mail";}

if (username=="" || password=="" || email=="")
{ alert("Please Fill out the following field:\n\n" + str);}
else {return submitFrm();}
}
</script>

<form name="submitform" method="post" action="" OnSubmit="Validate()">
<center>
<table border=2>
<tr><td>First Name:</td><td><input type="text" name="fname" size="32" /></td></tr>
<tr><td>Last Name:</td><td><input type="text" name="lname" size="32" /></td></tr>
<tr><td>Sex:</td><td><input type="radio" name="sex" value="Male">Male</input>
<input type="radio" name="sex" value="Female">Female</input></td></tr>
<tr><td>Username:</td><td><input type="text" name="username" size="32" /></td></tr>
<tr><td>Password:</td><td><input type="password" name="password" size="32" /></td></tr>
<tr><td>E-Mail:</td><td><input type="text" name="email" size="32" /></td></tr>
<tr><td></td><td><center><input type="submit" value="Submit" /><input type="reset" value="reset" /></center></td></tr>
</table>
<%
if request.querystring("new")="exists" then
Response.Write("Username already exists in database.")
end if
%>

It works fine, but I want to keep back the Firstname, lastname, sex, and e-mail values. How can I keep the values once it redirect the newuser page.

Because, if there is one invalide value, then it will redirect the same page and remove all values I input.

How can I keep firstname, lastname, sex, and e-mail values?
Thanks.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingASP Development > Keep the values when it redirect the same page


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap