Min Number Validation In Text Field
i know in html you can set a "max" character limit for a form field.I was wondering if it is possible to set a min number of characters?
View Repliesi know in html you can set a "max" character limit for a form field.I was wondering if it is possible to set a min number of characters?
View RepliesI need help regarding the string. In HTML page i have a text field to enter Name. How do i check whether its valid name or not, on the server side.
View Replies View RelatedI'm looking for a script or direction to help to find a script (maybe java?) that will validate an email based on comparing it to another email text field. So when one enters an email and then "confirm email. The two entries must match. This form is .asp. This should be client side validation and not through my server.
View Replies View RelatedI have a text field in a web page I am working on that seems to be calculating phone numbers before inserting them into an Access database. i.e., 867-5309 will result as -4442 in the Access text field. My guess is that the webserver or client is processing it before inserting it. Is there any way to stop this other than using a validation script?
View Replies View RelatedI need to insert some number into database as text. My problem is if I insert the number (ie. 4.0), the value in the database only show (4). So, is it possible to convert a real number into text number using ASP?
View Replies View Relatedi'm trying to validate telephone number from a form page. The telephone number must start with an 0 and have 11 digit. I'm doing teh validation on server side, i'm able to do the validation in asp.net with regular expression but finding it difficult to do it with ASP. here is an example of how i validated my email address: Code:
View Replies View RelatedI've got a page whereby i need to make sure only one email address is entered. As multiple addresses causes havoc. Any ideas on how to approach this.
View Replies View RelatedWe have a shared hosting plan (Windows-based) with GoDaddy.com. GD.com has a
"generic" form mailer script (gdform.asp) that allows us to set up a
"Contact Us" page, which, when the user clicks "Submit" sends an email to
us.
I am a complete newbie re asp, but looking at the code, it looks to me as if
a error is generated if any of the fields are left blank--which is good. I
don't want to be getting emails that don't contain messages, or that don't
contain a return email address.
However, submitting a completely blank form results in me getting an email
with blank response fields.
Can you take a look at this code and tell me if it should be allowing blank
fields to be submitted? Are there any changes that can be made? Code:
I would like to make two field in a for required fields. Do you all know a simple way to accomplish this? I can post form and any asp if needed( page is getting really huge).
View Replies View RelatedI have a form field on an ASP page and was wondering if I can require the number that is entered to begin with a 0 or a 2.If the number starts with anything else,the user is notified to update the number correctly(Your [FormField] must begin with a 0 or a 2, Please update your entry).
View Replies View RelatedI need to do an email validation field. I found this on the net . Code:
if (/^w+([.-]?w+)*@w+([.-]?w+)*(.w{2,3})+$/.test(myForm.txtEmail.value)){
alert("Email valid")
return (true)
Can some explain what the words in underline means ?
Alright what I need to be able to do is to make the field it's maxlength if the user does not enter enough characters.
<input type="hidden" name="B" size="10" maxlength="6" value="">
so basicly if the user enters a 5, 4, 3, or 2 digit number the input will be forced to it's maxlength. I need this because I am writing to an SQL db and am combining multiple form inputs into one field in the db table ie(variable = A&B&C&D)
On a different webpage I need to display the variables. I am doing this by string manipulation functions like the one below.
Nbr = mid(aTable1Values(DATA, aRowLoop), 6, 6)
(DATA = A&B&C&D)
how to validate a DATE field i have written my own javscript method but it's not considering all apects so is there any readymade method to check date.
View Replies View RelatedI have a problem. Of course, or I wouldn't be posting here. Ok, now that Mr. Obvious is out of the way ...
I'm looking for some ideas. Take a look at the code below. I'm looking for the most efficient way to validate form field input on the server-side. I'll provide what I have. What I'm looking for are improvements.
<%
Function Validate_Input(Expression,Pattern)
Dim objRegExp
if Expression <> "" and Pattern <> "" then
Set objRegExp = New RegExp
select case (Pattern)
case "US_PHONE"
' sample matches: 1-(123)-123-1234 / 123 123 1234 / 1-800-ALPHNUM
' sample non-matches: 1.123.123.1234 / (123)-1234-123 / 123-1234
objRegExp.Pattern= "^([0-9]( |-)?)?((?[0-9]{3})?|[0-9]{3})( |-)?([0-9]{3}( |-)?[0-9]{4}|[a-zA-Z0-9]{7})$"
case "US_DATE"
' sample matches: 02/29/2084 / 01/31/2000 / 11/30/2000
' sample non-matches: 02/29/2083 / 11/31/2000 / 01/32/2000
objRegExp.Pattern= "(((0[13578]|10|12)([-./])(0[1-9]|[12][0-9]|3[01])([-./])(d{4}))|((0[469]|11)([-./])([0][1-9]|[12][0-9]|30)([-./])(d{4}))|((2)([-./])(0[1-9]|1[0-9]|2[0-8])([-./])(d{4}))|((2)(.|-|/)(29)([-./])([02468][048]00))|((2)([-./])(29)([-./])([13579][26]00))|((2)([-./])(29)([-./])([0-9][0-9][0][48]))|((2)([-./])(29)([-./])([0-9][0-9][2468][048]))|((2)([-./])(29)([-./])([0-9][0-9][13579][26])))"
case "EMAIL_ADDRESS"
' sample matches: asmith@mactec.com / foo12@foo.edu / bob.smith@foo.tv
' sample non-matches: joe / @foo.com / a@a
objRegExp.Pattern= "^([a-zA-Z0-9_-.47]+)@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.)|(([a-zA-Z0-9-]+.)+))([a-zA-Z]{2,7}|[0-9]{1,3})(]?)$"
'The next line is supposed to be an RFC 2822 address compliant validation expression
'objRegExp.Pattern= "^(?:[w!#$\%&'*+-/=?^`{|}~]+.)*[w!#$\%&'*+-/=?^`{|}~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-](?!.)){0,61}[a-zA-Z0-9]?.)+[a-zA-Z0-9](?:[a-zA-Z0-9-](?!$)){0,61}[a-zA-Z0-9]?)|(?:[(?:(?:[01]?d{1,2}|2[0-4]d|25[0-5]).){3}(?:[01]?d{1,2}|2[0-4]d|25[0-5])]))$
case "ZIP"
' sample matches: 78754 / 78754-1234 / G3H 6A3
' sample non-matches: 78754-12aA / 7875A / g3h6a3
objRegExp.Pattern= "^(d{5}-d{4}|d{5})$|^([a-zA-Z]d[a-zA-Z] d[a-zA-Z]d)$"
case "CREDIT_CARD"
' sample matches: 6011-1111-1111-1111 / 5423-1111-1111-1111 / 341111111111111
' sample non-matches: 4111-111-111-111 / 3411-1111-1111-111 / Visa
objRegExp.Pattern= "^((4d{3})|(5[1-5]d{2})|(6011))-?d{4}-?d{4}-?d{4}|3[4,7]d{13}$"
case "NAME"
' sample matches: T.F. Johnson / John O'Neil / Mary-Kate Johnson
' sample non-matches: sam_johnson / Joe--Bob Jones / dfjsd0rd
objRegExp.Pattern= "^[a-zA-Z]+(([',.- ][a-zA-Z ])?[a-zA-Z]*)*$"
case "ADDRESS"
' sample matches: 2222 Mock St. / 1 A St. / 555-1212
' sample non-matches: [A Street] / (3 A St.) / {34 C Ave.}
objRegExp.Pattern= "^[a-zA-Z0-9s.-]+$"
case "CURRENCY"
' sample matches: $3,023,123.34 / 9,876,453 / 123456.78
' sample non-matches: 4,33,234.34 / $1.234 / abc
objRegExp.Pattern= "^$?([0-9]{1,3},([0-9]{3},)*[0-9]{3}|[0-9]+)(.[0-9][0-9])?$"
case else
Response.Write("Invalid syntax used to call form validation function.")
Response.End
end select
Validate_Input = objRegExp.Test(Expression)
else
Response.Write("Invalid syntax used to call form validation function.")
Response.End
end if
End Function
' Get data from the form collection and assign to variables
dim str_Customer_Email
dim str_Customer_Phone
dim str_Customer_Name
dim str_Customer_Zip
str_Customer_Email= Request.Form("email")
str_Customer_Phone= Request.Form("phone")
str_Customer_Name= Request.Form("name")
str_Customer_Zip= Request.Form("zip")
if not (Validate_Input(str_Customer_Email,"EMAIL_ADDRESS")) then response.write ("error")
if not (Validate_Input(str_Customer_Phone,"US_PHONE")) then response.write ("error")
if not (Validate_Input(str_Customer_Name,"NAME")) then response.write ("error")
if not (Validate_Input(str_Customer_Zip,"ZIP")) then response.write ("error")
response.end
%>
Now, I'll obviously want to do more than write "error" to the screen with the validated input. What I *really* want ideas on is a more efficient way to validate the fields. In this small example doing them as one-offs isn't bad. On a form that has 20-30 fields it becomes cumbersome.
I need a text box to only take 6 digits. It should work like this:
If the user inserts say '89' form would actually send over '000089'. Likewise if they inserted 1234, again the form would send 001234, if they inserted 1 it would send 000001 and so on..
Yes, the easy way round this would be to give the users a message to input the data as 001234 for example, but is there any way this can be done dynamically?
It shows the data but not like in the data table (Access). I would like that the numbers have a 2 digit decimal behind the comma i.e.123.456,30 and negative numbers should be in red and in brackets i.e. (123.456,30) So, the format should be:
$#.##0,00;($#.##0,00)[Red] as I have done it in the table - but not in ASP
Where do I have to enter the format in the ASP code? - or - Where do I have to enter the format in the Html code? Is someone able to write me the coding line?
i need my field that is 10.00 and turn it into this 00001000 any ideas.
View Replies View RelatedI have one auto number problem in one table in sql server 2000. I'm inserting new record using insert statement and am not giving any value for that field as its auto number.
On the very next statement , I need to know which number it inserted in auto number field for that record??What should be the logic?
How would I change the following update statement so that if one of the AreaCode fields was blank, that it passes instead of saying Syntax error in UPDATE statement?
Quote:
sqlString = "UPDATE Installers SET Company='" & Request.Form("company1") & "', [Contact]='" & Request.Form("contact") & "', Phone='" & Request.Form("phone") & "', Fax='" & Request.Form("fax") & "', Email='" & Request.Form("email") & "', Website='" & Request.Form("website") & "', Address='" & Request.Form("address") & "', City='" & Request.Form("city") & "', State='" & Request.Form("state") & "', ZipCode='" & Request.Form("zipcode") & "', Country='" & Request.Form("country") & "', AreaCode=" & Request.Form("areacode1") & ", AreaCode2=" & Request.Form("areacode2") & ", AreaCode3=" & Request.Form("areacode3") & ", AreaCode4=" & Request.Form("areacode4") & ", AreaCode5=" & Request.Form("areacode5") & ", AreaCode6=" & Request.Form("areacode6") & ", AreaCode7=" & Request.Form("areacode7") & " WHERE Company='" & Request.Form("company") & "'"
Using ASP, how would I make a field in an entry 'blank', baring in mind that its a number field. I have tried...
RS.Field("ReviewID") = ""
and
RS.Field("ReviewID") = vbnull
But it doesnt like either of them.
I have a form that has both static and dynamic fields. I have no problem validating the static data, but whenever I try and apply form validation to a dynamic text box that has repeated rows, the validation does not seem to take. Do I have to run that validation through a loop? Code:
View Replies View RelatedWhat's the best way to handle passing a null value to a number field in my Access database? Right now I am getting an INSERT INTO error when I am doing this. I tried doing the following:
Mon = Replace(Request.form("txtNewMon"),"","0") but it doesn't seem to work. Would you suggest doing an IF satement?
I am using filter to build a recordset of records using:
Recordset1.filter="sorter >'"&todayDate &"'"
I dont think that the sorter field is a number, so how can I ensure this at this stage?
I have a table [table] with two fields [type] and [ID]. I am trying to create a table with the number of IDs per distinct type. So, the return table would be {distinct [type]}, {count per {distinct [type]}. I am stumped; I believe this must be two queries?
View Replies View RelatedI want someone to enter an area code in a field. They would hit search, and it would pull up all records whose phone number starts with that area code entered. Code:
View Replies View Relatedsqlstr ="INSERT INTO BorrowerTab VALUES('" & strName & "','" & strEmail & "','" & strPhone & "')"
These are the 3 fields i wish to insert value.
I cannot do it because there is an auto-number field in my table.
How do i tackle this ?
The error tht i get is query or destination are not the same
I'm using ASP 3.0,IIS and Java script.I have created some text boxes Dynamically using java script.So the text boxes has got the same name. This is the code i'm using for that..
aTable1=document.all('myTableTBody1')
aRow1 = aTable1.insertRow(aTable1.rows.length);
aRow =aRow1
aCell = aRow.insertCell(0);
aCell.align = "Left";
aCell.width = "5%";
aCell.innerHTML = "<input type='text' name='Course' size='20'>";
Problem is that when i'm doing client side validation using javascript its not taking values..Here 2 or 3 or 4 text boxes with the course will be created when i use
this code:
if (document.Qualificationdetails.Course.value == "") {
window.alert ("Enter Course !");
document.Qualificationdetails.Course.focus();
return false;
}
it does not give any validation...
I'm trying to find the line number of a specific piece of text:
do while textFileOpen.AtEndOfStream=false
if textFileOpen.ReadLine=text2Find then
foundAt=textFileOpen.Line
end if
Loop
But it keeps giving the wrong line number
What I'd like is foundAt to be 0 then if the line is found foundAt is to be the line number, if it is not found stay at 0
In the script above foundAt at increments even though the text isn't in the line?
I also get a "Input past end of file" if text2find isn't found
I am making a check writing page and was wondering how to convert a variable in the form of $1234.56 to One Thousand Two Hundred Thirty Four Dollars and Fifty Six Cents (Or something like that).
View Replies View RelatedIm working on a number to text conversion in ASP, just like this : 456 = four hundred fifty six. If you have any cool function, In case you don't, how can I analyze the caracters of a number one by one, and know how much caracters a string has?
Ej = "1234" has 4 caracters
I need to modify some code written by someone else that sends out an automated email based on a form submittal. In the form, values are set to 1 or 0 for "yes" or "no". I need to modify it so that the email changes the 1 or 0 to their text equivalents (yes/no).
I CANNOT modify the form itself to change the variables, so i assume i need an IF stmt to that converts the string to text before it sends. Can someone point me in the right direction for how to do this?
is there anyway to convert a number into a text string? i.e. 1 to one or 2 to two.
View Replies View Relatedwhat's the easiest way to convert a number to text i.e.
2005 --> two thousand and five
67 --> sixty seven