Detecting Blank Fields
I am writing an application which when the code first loads there is a form which all the fields are blank. I then need to test some date fields to check if the end date is before the start date etc. The form fails to work. So I then wrote a test asp page which has a single box I then use an If...
Else statement if it is Blank then do nothing if it has data in the text box then display a message. The form works ok until I input text and then it does not detect any input text in it and therefore does not display the message. This is totally the oppoisite of the original application which does not detect the form is empty. Code:
View Replies
ADVERTISEMENT
I' m getting a (0x80040E2F) error, if I submit my form, with blank textboxes
to my update stored procedure. The stored procedure expect values, so how
can I detect if a form field was empty. I've tried testing to see if the
form field is null, blank and to count the characters, but I can't get it
working. My SQL table allows nulls, so it's not that.
View Replies
View Related
All my fields give that error when I try to leave it blank when inserting a new record. The field is not required in the database, so what do I have to do to insert it as blank?
SQL:
Code:
INSERT INTO Tablename (REQUIRED, NOTREQUIRED) VALUES ('tag', '')
Error:
Code:
[Microsoft][ODBC Microsoft Access Driver] Field 'Tablename.NOTREQUIRED' cannot be a zero-length string.
View Replies
View Related
I'm using ASP FormMail to collect user info, but now I'm trying to figure out how to modify the code so that any blank fields from the form will not be displayed on the confirmation page/email. I tried to modify the code below in bold, but it gave me a syntax error. Code:
View Replies
View Related
I have created a database were you submit a job by entering the fields which is fine if it is a site visit but if it is a phone call or remote help not all the fields need to be filled in but if there not filled in it wont submit the values to the database i get data mismatch error code is below.
I either need to be able to send them blank values to the database or ideally i wont to create a option box with Phone call, Site visit and remote help which when selected takes you to the correct page which have different values in the form to fill in.
View Replies
View Related
I've written an ASP page that pulls all records from a table. My query
is 'SELECT * FROM teacher ORDER by Class'
It is working fine... sorta. The table has about 20 records, but only
5 have an entry in the 'Class' field. The 15 records with the blank
class field show up first, then the other 5 records. Is it possible to
have the blank one show after the ones with an entry. Here's how my
results look, IOW. Code:
View Replies
View Related
I have entries in the database that have spaces (Todd's Place) but when I try to get the info into an input box it only shows the first part of the string before the space (Todd's) Here is my code
strSQL = "SELECT ID, memname FROM tblMembers WHERE ID =" & numID
Set rsEdit = adoCon.Execute (strSQL)
<input type=text value=<%= rsEdit.Fields("memname").Value %>>
The funny thing is I can see the whole string when I view the source on the page (<input type=text value=Todd's Place>) but why can't I see it in the form.
View Replies
View Related
I created a feedback form for my website that has only 2 required fields. When you submit the form it calls my asp page which puts the information in a database and then sends me n email with the information that was entered into the form. The problem is that the form only has two required fileds, and if the remaining non required fields are left empty when the asp page is called it does write to the data base, but does not send me any email. However if I go back in and put somethng in every field in the form then when I submit the form and my asp page is called it writes to the data base and sends me an email with the all the information I entered in the feedback form. Is there a way to tell my asp page that it is ok to send the email even if the non required fields are left empty? I really do not want to have to go back through the form and put default values in for each area of the form? Also is there a way to have an error displayed if the email is not sent? My asp code is below....
View Replies
View Related
how do u detect what the current pagename is (i.e. page.asp). also if the
command is stored in the include will it return the include file name or the
page that the command is included in name?
View Replies
View Related
I have a Javascript to detect whether a client's browser has flash installed, but as so many people are putting me off relying on Javascript, could you please let me know if you know how to detect whether a browser has flash installed using ASP.
View Replies
View Related
Is there any way to detect a mac using ASP? I am trying to let a mac with no referer into my site, but NOT any other OS that does not come from my site
for instance:
If OS = Mac & http_referer = "" then
do nothing
else
If OS <> Mac & http_referer <> "http://www.mysite.com/" then
response.redirect "http://www.notmysite.com/"
end if
Here's what I have so far:
View Replies
View Related
I have an ASP website which curently sends emails via CDONTS.
Sometimes emails are not getting sent and there is no way to detect
the error.
I would like to be able to log on a database that an email has been
sucsessfully sent or log an arror on a database if the email has
failed. One ways I have thought of is to call a VB.NET DLL which I
have written (I only have .NET not VB6!!). But i ma not sure how to
call a VB.NET DLL from an ASP page.
View Replies
View Related
Is it possible to measure the time it takes an amount of bytes to reach the server with asp?
View Replies
View Related
How can you detect if it is a bot that's visiting your page, or a real person? Is it in the 'Request' class or what?
I know you can ban bots from crawling your page, but this is not want I want to do, I just want a script that can define if its a real person thats visitng your webpage, or a spider.
View Replies
View Related
I've got a page that increments a count when the page is hit. The problem is, I do not want search engine spiders to affect this count. I'd like to wrap the increment code in an if/then statement so that it doesn't get triggered when it sees that the visitor is a spider.How do I sense that spider? Is it with the server.variables("referrer")? Is there a good list anywhere of the names of the major search engine spiders?
View Replies
View Related
At the moment i am checking that all the fields have been filled out, at the moment i am using the following...
if firstname = "" and surname = "" and address1 = "" and town = "" and
county = "" and country = "" and postcode = "" and phone = "" and email11 =
"" and email2 = "" and password1 = "" and password2 = "" then
is there a better more efficient way of doing this?
View Replies
View Related
I have a DB with 3 fields.
ID
Name
EMail
If I write an entry into this DB, Name and EMail, the ID is auto increment. How can I detect what ID has been created ? I want a user to submit details to me, they get the ID as a ticket number ?
View Replies
View Related
I have a page with a pop up window for a 800x600 resolution. But people using a different resolution will not benefit. So is there an asp script to detect what resolution people are using. And by detecting this it will alter the pop up screen size. Get what i mean?
View Replies
View Related
I am planning out the stages for an application at work, the application
needs to detect when a client has emailed 'us' and then trigger a new row
written to a database and email the client back by return.
I can see how most of what our application needs to do can be achieved with
ASP/SQL Server - but the part I am unsure of is the email detection...I
suppose the closest thing to what we are aiming for would be one of those
'helpdesk' apps that many companies have - you email them - you get an
automated confirmation email back by return with a ticket number etc etc -
anyone got any ideas on how I can achieve this?
View Replies
View Related
I have a form that also allows an image to be uploaded.
<input type="file" name="Upload">
How can I detect if a file has been uploaded, example
if [upload has been made] then
Do thing A
else
Do thing B
end if
View Replies
View Related
I'm writing a script to add documents to a database, that can be sorted via date. As the date doesn't necessarily corrospond with the day the document is being added (i.e. it could have been orignally published in 1999) I have created a series of dropdown menus that allow the user to choose day, month and year. However, they could potentially choose, for exmple, 31st of February, which will generate a database error.
How can my code intelligently detect an invalid date before it generates a database error? Every system I can think of is overcomplicated for such a seemingly simple problem.
View Replies
View Related
I have a program written in ASP. Normally it is all done by using include file etc.The client has asked for the program to be rewritten using frames. This can be done, but I have of course told the client that includes are better than frames and more easily manageable. Despite that advise the client wants to press on .
I have worked out a means by which I can move everything over to frames. How do I detect and ascertain if a page has been opened in a frame; if it has determine the name of the parent frame; and ensure it cannot be opened else where - ie another frame or window without a frame ?
View Replies
View Related
What i wanna be able to do is make something where my server say, www.billy.com can do something like this:
if yahoo.com/images/banner.jpg = true
then response.write "That image was detected"
else
response."write" "That image was not detected"
View Replies
View Related
Is there any way in VB ASP of identifying if an image which is placed on a page fails (if it's simply not been put on the server for instance so IE gives it a red X)? I want to detect this if it happens and display a default image or something.
View Replies
View Related
i'd like to know if there is some way to detect whether a field is of type MEMO (i'm using MS Access) so to behave accordingly placing a textarea instead of a textbox in the UI.
View Replies
View Related
I know there must be a JavaScript way, but is there a VBScript way? I asked here, because if there's a javascript way I need to also use VB with it...since I want to trim an image if it's over a certain size...
For example:
Picture from database: width = ? height = ?
Detect image size as width = 300 height = 250
Trim image down to 200 x 150
Example 2:
Image width = 300 but height is OK, at 150
Trim width to 200 ....
View Replies
View Related
Is it possible to use IIS 5.x software on WinXP/2K OS and VBScript to detect the logged in user account.
ie, we login with our firstname initial, last name (amartone) as well as the domain the computer resides in? My account is under ITU, so I am ITUamartone.
Can ASP detect this? I'm making an intranet app, and I'd rather validate users that way than have them log in over and over.
View Replies
View Related
Can I use request.servervariables("HTTP_USER_AGENT") to determine if the user has Firefox or Internet Explorer? Is the return string differentiated enough?
View Replies
View Related
We have a company intranet based on ASP (Win2k, IIS 5.0, SQLServer 7.0). For security purpose, my boss wants to block some employees from logging in to our intranet except for from our factory. Our factory has a SBC DSL (one dynamic IP and it's shared). I know how to get the client pc's IP address. But as the IP address is dynamic, I cannot depend on it.
Is there a way that I can detect the user is accessing from our factory (like router's MAC address)? One way I brought up is making a page to record the client computer's ip and making one of our factory's computers automatically call the page. But this scheme is incomplete as you know.
View Replies
View Related
We have an ASP script for updating web content which deploys a whole bunch of files from one server to another on the click of a button. Here are the steps it takes - pretty simple:
1. Delete all files requiring an update from Server B (remote server)
2. Copy all new files from Server A (local) to Server B
The problem is that many of these files are ASP scripts themselves and if someone is browsing the 'live' website on Server B (remote) then IIS will have the current scripts locked. So our delete script runs but gets to a file locked by IIS and fails, having deleted half the site, and does not continue with copying over the new version of the site. Very messy! I have to Remote Access to the server, wait for a gap in usage and manually delete the offending scripts before running the 'Deploy' functionality again.
So, I need to be able to check if a file is locked and ignore it in the process (perhaps reporting on that later) or be able to over-write locked files regardless. Code:
View Replies
View Related
I want to redirect users who DO NOT SUPPORT sessions to another page.
Think this will work? PSEUDO CODE:
-------------------------------------------------------------------
<asp vbscript>
<session("test")="true">
<if session("test")="true" then do nothing else
response.redirect(www.domain.com/nosessions) end if>
-------------------------------------------------------------------
This is setting a session state of "true", and I presume if sessions are
disabled for security reasons, that the site will redirect accordingly?
View Replies
View Related
I need to be able to execute some code or display a popup when a user leaves the site. Does anyone know if it is possible to detect this? Is there an event that is called before the user leaves where I could put some code?
View Replies
View Related
I'm new to using session cookies and need just a bit of help. On the introduction page to my project, I'm setting:
<%@ Language=VBScript %>
<%
response.cookies("user")="authenticated"
%>
Then, on subsequent pages, I'm checking for the cookie, and redirecting if it's not there:
<%@ Language=VBScript %>
<%
If NOT request.cookies("user") = "authenticated" Then
response.redirect "http://somepage"
End If
%>
What I need to do is incorporate an ignore element (by user-agent or IP) into where it checks for the cookie. For instance, if a user has an IP of 127.0.0.1, it ignores whether they have the cookie or not and lets them view the page.
The reason I'm doing this is I have a search engine that's crawling the site and it doesn't always go through the front page - therefore, it's getting redirected on most of the pages it sees. So what I'd like to do is have the script see that user-agent or IP, then ignore the cookie requirement.
Is that possible?
View Replies
View Related