Basic Error Checking Within ASP In A Form

how to create a form that would handle basic error checking within the ASP itself?

View Replies


ADVERTISEMENT

Error Checking A Form

i'm making a forum, and previously i was submitting the form to an asp file, which would check for errors -- if there were errors, it would redirect back to the form with error messages to be displayed -- if it was error free, the message would be written to a txt file.

but then i wanted to put in a preview message page, and so error checking and passing values between the three pages is becoming tricky. so i'm at the point where i'm starting to use javascript to error-check, which works fine for making sure the input is good, but i don't know a good way to notify the user that there are errors with javascript. alert messages are unprofessional, and i can't just add text to the page using javascript.

i'd prefer to use only asp, and i'd prefer it if i didn't have to use an extra asp page JUST to error-check. as it is now i have these pages involved in adding a new subject:

post subject (has the form for the subject and message; the user can click either post message, which will directly write the message, or preview message, which will bring them to a page which displays the post as it would appear once written)

preview message (regardless of what the user clicks, it would come here first to do error checking, and depending on what the user clicked it would either redirect to the page which writes the subject, or display the message;

the problem is, if there are errors with the form, i need to point the user back to post subject without losing whatever info they have already entered. the only way i know how to do that is by submitting a form [i can't use a querystring because it won't maintain the message if the user entered multiple lines in the message])

add subject (this does the backend writing of the message, and is only accessed if the fields have made it through the error-checking)

any solutions in mind on how to pass the field values between these three pages?? or is there a better way i can do error checking??

View Replies View Related

Basic Contact Form

i have a basic contact form on a website and im trying get an asp script to send an email off to the sites sales people.

View Replies View Related

ASP.NET Exporting To Excel - Basic Error

The code below (partial) should export a file as Excel when the button near the bottom is clicked. The example I pulled the concept from uses a GridView for binding. I don't need to display it, just export it, so I created ExcelGrid visible=false at the bottom. The Response.Write(strQuery); is never getting executed. I get:

Exception Details: System.Web.HttpException: Control 'ExcelGrid' of type 'GridView' must be placed inside a form tag with runat=server.

I'm almost positive (from what you see below) that my ExcelGrid is inside the form tag, which contains the runat=server.

Any ideas? It works when you pull that code and just run the rest of the form so the runat=server is working for all of the other controls! Code:

View Replies View Related

Form Checking With Reg Exp

The script is designed as a form validator which checks fields for various criteria and then sends a mail with the form contents. Since 40 different forms will be plugged into this script, there needed to be complete seperation between the two.

I've managed it so far by checking for required fields by putting the word 'required' into the name of the field. The script then sources out any fields which has this text and checks them to see if they are filled out.

The problem I've come across now is that I need to check for field length. My idea was to put the amount of characters needed into the name of the field in the form and then have the script check with a Reg Exp. However, Im not too sure of the regular expression needed to check for this.

Can someone suggest one? The one I have at the moment is [1-14] but say I had a field like this: <input type="text" name="passwordrequired12"> That would match bout for 1 and 12. Any ideas?

View Replies View Related

Checking A IP Sent From Form

I have a form field that will contain an IP based on a TeamSpeak or Ventrilo IP. What I need to do, is check to make sure there are 4 groups of numbers in the form field. Or, check to see if the entry contains 3 periods. 1.2.3.4 <--- example there are 4 groups, and 3 periods.

Now of course, the IP can be as large as 4 groups of 3 numbers, so I can't check string length. how would I check this and validate it on my asp processing page?

View Replies View Related

Checking A Form

I need to check a form to make sure the ID is between 8-15 characters and the password is between 8-10. I can create the form, but am not sure how I could check these lengths. i'm sure there is some simple code and also I do not know where I would put it.

View Replies View Related

Checking Db Before Submitting A Form

I have a form that currently input data into an access db. The first thing that I would like to happen when the Submit button is clicked, is to check one column in the database to see if there are any duplicates before uploading any data. So my question is, how?

View Replies View Related

Checking Fields In A Form

How do I check the field for example zip code to make sure that it has 5 digits?

View Replies View Related

Checking Form Values

Is there an easy way in ASP to check the value of a form element, like a hidden field, of the current page, not the previous page?

View Replies View Related

Checking Form Field

I'm trying to verify a request.form("blah") with a field (value) in a recordset taken from an Access Database. Basically what I'm trying to do is once this NUMBER is entered into the form object (textfield), check a database to see if this number has been used (i.e. in the database) and if so redirect them to an error page.

I thought this would be rtight, but doesn't seem to work

If rsTeddyCheck = Request.Form("PersonalID") then
response.redirect ("Error.asp")
Else
process.asp
End If

View Replies View Related

Checking For Nothing Entered In An Asp Form Post

How do you check for a empty value from a form?

lservice = request.form("pservice")

if not isnull(lservice) then <== this doesnt work.
tried "" empty string and it still didnt work.
......

I'm having problems with the fact the user didnt enter anything. The field is optional.

View Replies View Related

ASP Error Checking ...

I am writing a script that lets me brows the contents of a web server. The problem is the account that is running ASP does not have permissions to every folder. Don't ask me why ... I have no idea but it can't be changed.

What I would like to do is perform a check for:

Microsoft VBScript runtime error '800a0046':Permission denied

And if this happens display an error message saying they do not have permission to view this directory. Code:

View Replies View Related

Error Checking Fix

How to re-write this so it can error check for each individual field. Username, email, password etc.

This is written and validates if the user already has an account in the Database. then it returns the messaage below. But I would like to indentify if it is the username that exist or the email or password. Code:

View Replies View Related

Error Checking

why this string fails to check if a user does not enter any data in a field?

<%
' Declaring variables
Dim make, model, description, price, data_source, con, sql_insert
' A Function to check if a field is empty
Function ChkString(string)
If string = "" Then string = " "
ChkString = Replace(string, "'", "''")
End Function

' Receiving values from form
make = ChkString(Request.Form("Make"))
model = ChkString(Request.Form("Model")) and so on and so forth...
%>

View Replies View Related

Error Checking

what would be the best way to error check a page after I clicked submit but before I go on. Example:

I have a page that dynamically puts text boxes & lists on a page depending upon which button I click on the main menu. What I want to do is check the text boxes for correct values (most likely before I go to the next page which is the Update page). But since I am dynamically creating the page & text boxes I don't know what the names are... I am doing the dynamic page through server side script.

This means that almost all my variables names and anything associated with the dynamic page are in the Server Side script and can't be reached by Client Side script. ok long story short which is best to error check a dynamic page before updating the info on that page. Server Side | Client Side script?

View Replies View Related

Checking Error Code

I'm setting up a simple competition entry system in ASP where users can enter their name and email address to be added into a prize draw. It's pretty simple stuff, with the data being added into an Access DB table.I've created an index on the 'email' field to stop the same person entering more than once (unless they have more than one address, but let's pretend that's never the case ).Instead of doing a SELECT query to find whether they've entered before, I simply want to attempt to INSERT the data into the table, and if it returns an error along the lines of "no duplicate values in the index" it would give the user an error.My question is, is it possible to display a user-friendly version of the standard ugly ASP generated error message when this error is detected? Or am I stuck with the incredibly unattractive error message we're used to?

View Replies View Related

Error Checking In ASP Code

In Kevin Yank's book, he shows how to put in error checking at various stages of working with a database: connecting, querying, etc. I presume the same general principles apply to ASP/SQLServer but I don't know the code. Can someone tell me at what stages I should be checking for errors and some generic code that I could use at each stage?

View Replies View Related

Form Validation(checking For Digits And Blank Spaces)

i have a form for users to enter their name password and e-mail,i am currently using javascript to check that all details have been filled,

if(myForm.fname.value=='')
{
alert("Plz enter a first name")
return false
}

This works if the field is left blank however if the user enters numbers(1,2) or spaces i.e.(" ") how do i deal with these,i also need to check that the e-mail contains "@" and "."

View Replies View Related

Error-checking And Query-results After Execute

After commands like:

tmpDBconn.Execute("DELETE * FROM mytable WHERE rc_id = 10" )
How do I check for errors?
Is there a way to check the results?

OR:

Set rsCatCount = tmpDBconn.Execute("SELECT COUNT(*) FROM cat WHERE key_id = 10 AND cat_id = 6")

How do I get the count? Do I use rsCatCount(0)?

View Replies View Related

FTP Put Via ASP Using Visual Basic

I've read hundreds of posts regarding this, but haven't got a working solution yet. Does anyone have a working snippet of code from an ASP page that can be used to upload a file to an FTP server? I read all about INET, but due to some licensing issues it won't work....

View Replies View Related

ASP.net And IIS Basic Question

ASP.net is that what is used to create web pages on a server such as IIS?
ASP.net is part of visual studio, what software package contains IIS?

View Replies View Related

Basic Authentication

I have an XML file which I access from a remote server like

Set http = CreateObject("MSXML2.ServerXMLHTTP")
http.open "GET","http://www.andrewlouis.co.uk/viewcountries.xml",false
http.send
strXML = http.responseText

The real server is password protected with, I think, with basic
authentication. How do I pass it the username and password.

View Replies View Related

Basic ASP Problem

This is ALL the code that i have..

<%
response.write("This is a test")
%>

the file is saved as test.asp

I have uploaded it, and when i run it, I get the code being displayed ie.
<%
response.write("This is a test")
%>

View Replies View Related

Basic Search

I am having one asp page in which a table is displayed. The table displays the values in textboxes.when the client uses search functionality it searches in the whole page but doesnt search in the table. Can any one tell me about how to search the values contained in textboxes in the table.if possible give me some code

View Replies View Related

Basic Update

However I have a complicated update page so I am going to hand code it. I started by breaking down to the basics of Updating but I keep getting a 'Syntax error in UPDATE statement' error. Can anybody see where I am going wrong?:

<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="../Connections/Publishing.asp" -->
<% If Request("Submit") <> "" Then %>
<%

set Command1 = Server.CreateObject("ADODB.Command")
Command1.ActiveConnection = MM_Publishing_STRING
Command1.CommandText = "UPDATE Test SET Value = Paul WHERE ID = 2 "
Command1.CommandType = 1
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()

%>
<% End If %>

View Replies View Related

Visual Basic

Is there one? I need to hash a sensative string before inserting it into the sql server database. It HAS to be done in the ASP code, because it is also stored in a cookie. Any ideas? Server asp code is vbscript.

View Replies View Related

MSN API In Visual Basic...

I need source code for a simple MSN API example, something that interacts between MSN's controls. I want to break it down test it and use it for my own applications.

Or can people even suggest free source code sites for VB. I can search for them there. Planet-source-code had an AMAZING app, but it wanted an ocx file which I obviously didn't have.

View Replies View Related

Basic Question

I have two simple problems which I think are related(?) I have a form with the folowing code:

<form method="post" action="sendemail.asp">
and
<input name="submit" type="button" value="SUBMIT">


when I click the submit button it does not go to sendemail,asp I have tried adding the full/parstial path infront of the sendemail.asp but no luck

Similarly I have the following code which I have taken an asp file from another project and changed the name accordingly but the image does not show Code:

View Replies View Related

Basic Authentication

I'm using MSXML2.ServerXMLHTTP to get a web page using an url with basic authentication (e.g. http://user:password@www.mysite.it).

Microsoft denied basic authentication within Internet Explorer URL (see KB 834489) so I'm unable to get the page contents.The client-side workaround is to change some registry settings (see http://support.microsoft.com/kb/834489), anybody can help me with a different solution ?

View Replies View Related

Basic Chat

How to create a basic chat?

View Replies View Related

Another Basic SQL Statement

I've got a field in my database called notes, where they of course are leaving notes for certain orders. I'd like to create a page that lists all orders that have notes left in them but I'm having trouble figuring out what sql statement to use. In my words it needs to say "select everything from the table where notes does not equal null"

I guess I just don't really know what to put for the null part. I'm thinking it'll be somehting like..

SELECT * FROM requests WHERE notes <> ...??? this is what I dont know.

View Replies View Related

Basic SQL Statement

i am trying to pull records using a partial name, here's what i have

PlayerName = "'" & "%" & txtFindPlayer.Text & "%" & "'"
this part works fine, for example text is 'ric'

Set rs = db.OpenRecordset("SELECT * FROM EVENT_SCORING_TBL WHERE PLAYER_NAME LIKE " & PlayerName & "")

no record containing 'ric' is found, but the syntax seems to be ok. Am i using the right wildcards? there is definatly an Eric in the database, but it doesnt pull. any suggestions?

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved