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.
5 4531
can u tell what u want to do ..
whether u want to post the data to nextpage
r else u want to check the use input data..
tell me in detail...
with regards
meenu
iam_clint 1,208
Recognized Expert Top Contributor
Based on the title of this thread -
<%
-
dim name
-
name = Request("name")
-
%>
-
First Name: <input type="text" value="<%=name%>">
-
or have no actuall submit button take action and onsubmit out of the form and use a button instead of a submit button and use on click so when you click it, it validates then sends the information otherwise you will stay on the same page and the javascript should display the errors without any refreshing done.
this will keep the values in the text field as the previous submitted form, if this wasn't what your are looking for then please rephrase your question.
hi...
save the following code as html file and test it in your local server...
< - html>
-
<head>
-
<title>Untitled Document</title>
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-
</head>
-
<SCRIPT LANGUAGE=javascript>
-
function fndelete()
-
-
{
-
if (document.form.category.value=="")
-
{
-
alert("Please select values !");
-
document.form.category.focus();
-
return false;
-
}
-
if (document.form.sname.value=="")
-
{
-
alert("Content Field is Empty !");
-
document.form.sname.focus();
-
return false;
-
}
-
if (document.form.style.value=="")
-
{
-
alert("Content Field is Empty !");
-
document.form.style.focus();
-
return false;
-
}
-
-
-
-
if (document.form.price.value=="")
-
{
-
alert("Content Field is Empty !");
-
document.form.price.focus();
-
return false;
-
}
-
if (document.form.shpcost.value=="")
-
{
-
alert("Content Field is Empty !");
-
document.form.shpcost.focus();
-
return false;
-
}
-
-
-
return true;
-
}
-
</SCRIPT>
-
-
-
-
<body bgcolor="#000000" text="#000000">
-
<div align="center"> <p> </p><p><font color="#FF9900" size="3" face="Arial, Helvetica, sans-serif"><b>Tshirt
-
Entry</b></font></p>
-
-
<form name="form" method=post action="insert.asp" onsubmit="return fndelete();">
-
<table width="44%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="41%" height="25">
-
<div align="left"><font color="#CCCCCC" face="Arial, Helvetica, sans-serif" size="2">Category</font></div></td><td width="59%" height="25">
-
<font color="#CCCCCC" face="Arial, Helvetica, sans-serif" size="2">
-
-
<SELECT NAME="category">
-
<option value="cooltshirt">cooltshirt</option>
-
<option value="funnytshirt">funnytshirt</option>
-
<option>Beefy-T Youth</option>
-
<option>Beefy-T Adult Long Sleeve </option>
-
<option>Playwear Toddler</option>
-
<option>Playwear Infant </option>
-
<option>Playwear Infant Creeper</option>
-
<option>Ultimate Crew Sweatshirt</option>
-
<option>3/4 Sleeve Raglan </option>
-
</SELECT></font></td></tr><TR>
-
<TD WIDTH="41%" HEIGHT="25"> <DIV ALIGN="left"><FONT COLOR="#CCCCCC" FACE="Arial, Helvetica, sans-serif" SIZE="2">Name</FONT></DIV></TD><TD WIDTH="59%" HEIGHT="25">
-
<FONT COLOR="#CCCCCC" FACE="Arial, Helvetica, sans-serif" SIZE="2"> <INPUT TYPE="text" NAME="name">
-
</FONT></TD></TR><TR> <TD WIDTH="41%" HEIGHT="25"> <DIV ALIGN="left"><FONT COLOR="#CCCCCC" FACE="Arial, Helvetica, sans-serif" SIZE="2">Style</FONT></DIV></TD><TD WIDTH="59%" HEIGHT="25">
-
<FONT COLOR="#CCCCCC" FACE="Arial, Helvetica, sans-serif" SIZE="2"> <SELECT NAME="style"><OPTION>mens</OPTION><OPTION>womens</OPTION><OPTION>kids</OPTION></SELECT></FONT></TD></TR><TR>
-
<TD WIDTH="41%" HEIGHT="25"> <DIV ALIGN="left"><FONT COLOR="#CCCCCC" FACE="Arial, Helvetica, sans-serif" SIZE="2">Color</FONT></DIV></TD><TD WIDTH="59%" HEIGHT="25">
-
<FONT COLOR="#CCCCCC" FACE="Arial, Helvetica, sans-serif" SIZE="2"> <INPUT TYPE="text" NAME="color">
-
</FONT></TD></TR><TR> <TD WIDTH="41%" HEIGHT="25"> <DIV ALIGN="left"><FONT COLOR="#CCCCCC" FACE="Arial, Helvetica, sans-serif" SIZE="2">Size</FONT></DIV></TD><TD WIDTH="59%" HEIGHT="25">
-
<FONT COLOR="#CCCCCC" FACE="Arial, Helvetica, sans-serif" SIZE="2"> <SELECT NAME="size">
-
<option>S</option>
-
<option>M</option>
-
<option>L</option>
-
<option>XL</option>
-
<option>XXL</option>
-
</SELECT></FONT></TD></TR><TR>
-
<TD WIDTH="41%" HEIGHT="25"> <DIV ALIGN="left"><FONT COLOR="#CCCCCC" FACE="Arial, Helvetica, sans-serif" SIZE="2">Quantity</FONT></DIV></TD><TD WIDTH="59%" HEIGHT="25">
-
<FONT COLOR="#CCCCCC" FACE="Arial, Helvetica, sans-serif" SIZE="2"> <SELECT NAME="qty">
-
<option>1</option>
-
<option>2</option>
-
<option>3</option>
-
<option>4</option>
-
<option>5</option>
-
<option>6</option>
-
<option>7</option>
-
<option>8</option>
-
<option>9</option>
-
<option>10</option>
-
</SELECT></FONT></TD></TR><TR>
-
<TD WIDTH="41%" HEIGHT="25"> <DIV ALIGN="left"><FONT COLOR="#CCCCCC" FACE="Arial, Helvetica, sans-serif" SIZE="2">Price</FONT></DIV></TD><TD WIDTH="59%" HEIGHT="25">
-
<FONT COLOR="#CCCCCC" FACE="Arial, Helvetica, sans-serif" SIZE="2"> <INPUT TYPE="text" NAME="price">
-
</FONT></TD></TR><TR> <TD WIDTH="41%" HEIGHT="25"> <DIV ALIGN="left"><FONT COLOR="#CCCCCC" FACE="Arial, Helvetica, sans-serif" SIZE="2">ShippingCost</FONT></DIV></TD><TD WIDTH="59%" HEIGHT="25">
-
<FONT COLOR="#CCCCCC" FACE="Arial, Helvetica, sans-serif" SIZE="2"> <INPUT TYPE="text" NAME="shpcost">
-
</FONT></TD></TR><TR> <TD WIDTH="41%" HEIGHT="25"> <DIV ALIGN="left"><FONT COLOR="#CCCCCC" FACE="Arial, Helvetica, sans-serif" SIZE="2">Image</FONT></DIV></TD><TD WIDTH="59%" HEIGHT="25">
-
<FONT COLOR="#CCCCCC" FACE="Arial, Helvetica, sans-serif" SIZE="2"> <INPUT TYPE="file" NAME="image"></FONT></TD></TR><TR>
-
<TD WIDTH="41%" HEIGHT="25"> <DIV ALIGN="left"><FONT COLOR="#CCCCCC" FACE="Arial, Helvetica, sans-serif" SIZE="2">Description</FONT></DIV></TD><TD WIDTH="59%" HEIGHT="25">
-
<FONT COLOR="#CCCCCC" FACE="Arial, Helvetica, sans-serif" SIZE="2"> <INPUT TYPE="text" NAME="descp">
-
</FONT></TD></TR><TR> <TD WIDTH="41%" HEIGHT="25"> <DIV ALIGN="left"><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#CCCCCC">Pattern</FONT></DIV></TD><TD WIDTH="59%" HEIGHT="25">
-
<FONT COLOR="#CCCCCC" FACE="Arial, Helvetica, sans-serif" SIZE="2"> <INPUT TYPE="text" NAME="pat">
-
</FONT></TD></TR><tr><td colspan="2"><DIV ALIGN="CENTER"><FONT COLOR="red" SIZE="2" FACE="bolditalic"><B><FONT COLOR="red" SIZE="2" FACE="bolditalic"><INPUT TYPE="submit" NAME= "a2" VALUE="insert" SIZE="4"></FONT></B></FONT></DIV></td></tr>
-
</table></form><p> </p><p>s</p><p> </p></div>
-
</body>
-
</html>
-
Niheel 2,456
Recognized Expert Moderator Top Contributor
Meenu,
Use the code tags , the " # " button to store code. Otherwise it disorts the page.
- KUB
hi KUB
how to do that...
i am new to this forum..
can u tell me how to do..
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Anne |
last post by:
hie there, i want to be able to pass multiple parameters
to another page. currently, i am able to do so, but
somehow i feel it is not the correct way to do it. below
is part of what i have so far.
'first page
Private Sub btnOK_ServerClick(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
btnOK.Click
Response.Redirect("InputValues.aspx?Requestor=" &
|
by: Peter Row |
last post by:
Hi,
I better get the background stuff out the way first, so here goes:
- Porting a VB6 webclass app to VB.NET using HttpHandlers and
FormsAuthentication
- When someone visits my site unbeknown to them they are automatically
logged in as a guest
via the .NET forms authentication.
|
by: Pete |
last post by:
Hi all...
I sincerly hope one of the MS guys can clear this up for me...
First some background...
Ok, I have a web site which is fully translatable into several
languages. All the strings for the web site are held in a database and
all the labels, buttons etc are populated at run time in the Page_Load
handler. The retreval of the strings from the database is all
|
by: Nad |
last post by:
Hello,
In order to go back to the previous page from a page with possible postbacks
I keep Request.Referrer in ViewState and then use it to redirect to the
previous page. However I am losing all the information entered in the
previous page. I also want to keep the entries in many fields/controls in the
previous page.
Is there a way to keep the information in the previous page intact when you
get back to it?
|
by: Adrian Parker |
last post by:
We have a website that works everywhere but on a few PCs on this one site..
Asp.Net 1.1
Server = Windows 2003
Client = XP
In the web.config we use - cookieless="false"
in the browser settings they have "Always allow session cookies" set to true
When the browser connects to the website the first page sets a session
variable called "user_ref" to something and then calls another page. If on
| |
by: KFactor |
last post by:
Is it possible to pass form variables to a page on another server using
response.redirect?
Or is there a secure way of passing sensitive information from one site to
another such as a userID?
I would like to avoid using the querystring.
This is what I would like to do:
When a user clicks on the link, I need to add them to the database and then
|
by: Sharon |
last post by:
hello all,
I was successfull in passing one value from first webpage to second
webpage, but not sure how to pass three textbox values from the first
page to the second page. Below is the code i was using to pass a single
value
First WebPage:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
|
by: John |
last post by:
Something strange has just started to happen as I have been developing
a db application on a site. Suddenly a session variable has stopped
working as I pass it from 1 page to another (I am sure it was OK a few
days ago).
I have done some tests.
$temp = 67;
echo $temp; gives 67 on this page
S_SESSION = $temp;
|
by: phpmagesh |
last post by:
Hi to all,
I am creating a registration page, like name, last name, Date of birth, ph number, address etc..
When i click submit button all the values are taking to validation page using POST method.
If any field is blank then script will say fill all the fields, then redirect to the registration page itself,
During this process when redirecting to registration page i should get the existing values which i typed already.
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |