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 4518
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
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>
-
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....
|
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...
|
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...
|
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...
|
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...
|
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?
...
|
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...
|
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...
|
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...
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
| |