15,912,756 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by wdodds20 (Top 2 by date)
wdodds20
12-Aug-20 1:08am
View
I got it somewhat close by using a function RegExp and then applying that to the SiteId field, however the way the page is written if a user selects or pastes a value in any of the other 4 fields VendId, PONbr, etc. then the data is returned to the page regardless of the SiteId being blank.
Any ideas?
<%@ Register TagPrefix="uc1" TagName="MenuBar" Src="MenuBar2.ascx" %>
<%@ Register TagPrefix="uc1" TagName="PV" Src="PV.ascx" %>
<%@ page language="vb" autoeventwireup="false" inherits="ReQlogicFW.Receipt, ReQlogicFW" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="PVDate.ascx" TagName="PVDate" TagPrefix="uc2" %>
<title>Receiving
function CheckMyText(sender, args) {
var compare = RegExp("\\d{1,}");
args.IsValid = compare.test(args.Value);
return;
}
<uc1:menubar id="MenuBar1" runat="server">
<asp:scriptmanager id="ScriptManager1" runat="server" enablescriptglobalization="true">
<asp:label id="LblPageHeading" runat="server"><% =Trim(Session("Page_Title")).ToString() %>
<asp:label id="lblUserId" runat="server">237@@Requester
<asp:textbox id="UserId" tabindex="9999" runat="server" columns="15" visible="True"><uc1:pv id="UserId_PV" runat="server">
<asp:label id="lblSiteId" runat="server">321@@Site
<asp:textbox id="SiteId" tabindex="9999" runat="server" columns="15" autopostback="True" required=""><uc1:pv id="SiteId_PV" tabindex="9999" runat="server">
<asp:customvalidator id="CustomValidator2" runat="server" errormessage="Error!" controltovalidate="SiteId" validateemptytext="true" clientvalidationfunction="CheckMyText">
<asp:label id="lblVendId" runat="server" designtimedragdrop="560"> 106@@Vendor
<asp:textbox id="VendId" tabindex="9999" runat="server" columns="15"><uc1:pv id="VendId_PV" tabindex="9999" runat="server">
<asp:checkbox id="AutoPrint" tabindex="9999" runat="server" text="1167@@Auto print receipt">
<asp:label id="lblReqNbr" runat="server">280@@ReqNbr
<asp:textbox id="ReqNbr" tabindex="9999" runat="server" columns="15"><uc1:pv id="ReqNbr_PV" tabindex="9999" runat="server">
<asp:label id="lblPONbr" runat="server">232@@PONbr
<asp:textbox id="PONbr" tabindex="9999" runat="server" columns="15" autopostback="True"><uc1:pv id="PONbr_PV" tabindex="9999" runat="server">
<asp:button cssclass="reqlogic-btn" id="Preview" tabindex="9999" runat="server" text="117@@Apply Filter">
wdodds20
12-Aug-20 0:19am
View
As far as the validation goes I just want to validate that something is entered into the field other than possibly a space. Sounds like that would be a RegularExpression validator?