Ask a Question related to ASP, Design and Development.
-
www #1
Detecting Blank form field
Hi there,
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.
thanks in advance
Charles
www Guest
-
Detecting the lenght of a MEMO field retrieved from a SQL database
Hi using VBScript, SQL, ASP I would like to show the contents of a memo field but only if it is not empty. I can do this with regular text... -
copy and paste form RTF document into field in asp form cause it to bypass field length and javascript validation - how to overcome?
I have a web form with several fields. If I copy & paste from a RTF document into a field, the javascript validation and field length are bypassed... -
Detecting if a field is required
Hi all, i need to detect whether a field is required or not. I'm using this code for building a string to convert later to an array (by Split) of... -
Detecting MEMO field
Hi all, 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... -
Detecting email format in text field
I have a database which can do a mail merge. The problem is that the mail merge will stop if there is an email such as "abc@hotmail.com." because... -
Lasse Edsvik #2
Re: Detecting Blank form field
www,
i assume you have:
CREATE .....
@a INT = NULL
AS
.......
<%
a = request.form("a")
........
if a<>"" then passthevalueAtoSP
%>
hope it makes sence :)
Best regards
/Lasse
"www" <charles@paltrack.co.za> wrote in message
news:3f5ede91$0$64720@hades.is.co.za...textboxes> Hi there,
>
> I' m getting a (0x80040E2F) error, if I submit my form, with blank> 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.
>
> thanks in advance
> Charles
>
>
Lasse Edsvik Guest
-
Dale J. Kovacs #3
Detecting Blank form field
Whether you are submitting the page back to itself, or to
another page you could simply embed your submit within a
logic structure.
exp:
If Request.Form("form_field1") <> "" AND _
Request.Form("form_field1") <> "" Then
'submit the form
End If
However it's always a good practice to make sure all
values submitted to your database are in the correct
format and then submit.
exp:
b_submit_form = True
'I set all my variables first so I can reuse them later
'or alter them as needed.
d_date = Request.Form("form_field1")
i_value = Request.Form("form_field2")
s_comments = Request.Form("form_field3")
'In this example I want to confirm that the entered value
'is a date.
If IsDate(d_submit_date) = False Then
b_submit_form = False
'you can reset the variable back to blank if you
'refill the form later.
d_submit_date = ""
'you can also set an error message to display to the user
s_error = s_error & "A date must be a valid date. "
End If
'In this example I want to confirm that the entered value
'is a number.
If IsNumeric(i_submit_value) = False Then
b_submit_form = False
s_error = s_error & "FormField2 must be a numeric
value. "
End If
'In this example I want to confirm that the form field is
'not blank.
If s_comments = "" Then
b_submit_form = False
s_error = s_error & "FormField3 must be entered. "
End If
'Each form field Item would be checked to confirm proper
'values then we can submit the form
If b_submit_form Then
'submit the form
If Err.Description <> "" Then
s_return_message = "The following error occurred: " &
Err.Description
Else
s_return_message = "Thank you."
Else
s_return_message = s_error
End If
Of course everyone has there own ways of doing things,
this is just how I do it to make sure everything is in
order prior to submitting it to the database, and to let
the user know when there are problems.
Hope this helps,
- Dale
Dale J. Kovacs Guest



Reply With Quote

