I am using ASP
In my company, all employees have to sent materials out of premises. Any employee who need to sent material out will use this web application. In the first page, an employee enters firm name, vehicle no, driver name, purpose, persons taking out, received by, remarks. In the second page, employee enters no. of materials to be taken out. In the third page, displays no. of rows for entry of material details like material name, serial_no., qty, weight remarks.
I have written validation for all field. All validation works well. In the third page, validation works well when no. of material taken out is 1. When it is > 1, then no validation works.
Please suggest me, what to do?
I am giving you code for entry and validation.
Thanks and regards,
Vikas
May 26 '08
18 2410 hsriat 1,654
Recognized Expert Top Contributor
OK Sir,
But the problem lies in this part, because when user clicks on second material row which is blank and the first being blank, then it gives the message for both, When I clicks on OK for 'Material must be entered' then it gives message for second row, when I clicks on OK for 'Material must be entered' then it gives message for first row. This process repeats for forever. And now Ctlr+Alt+C to close the browser.
What should I do?
Thanks and regards,
Vikas
Ok, you must be using IE?... Is it? .. very bad for a web developer!
Replace mat.focus(); with var x = setTimeout(mat. focus(), 10);
Here else part is not working. Actually I have very little idea about using else if (!mat.value.tes t(/^[\w\s]*$/i)) {
So please tell me what is wrong with this.
Thanks and regards,
Vikas
Oh, so you are calling this function onblur event?
Need to do a little modification then. - function checkmat(mat) {
-
if (mat.value=="") {
-
alert("Material must be entered");
-
mat.focus();
-
return;
-
}
-
else if (!mat.value.test(/^[\w\s]*$/i)) {
-
alert("Special characters are not allowed.");
-
mat.focus();
-
return;
-
}
-
return;
-
}
And write checkmat(this) instead of checkmat().
acoder 16,027
Recognized Expert Moderator MVP
When you say it's not working, be more specific. How is it not working? What happens and what do you expect to happen?
When you say it's not working, be more specific. How is it not working? What happens and what do you expect to happen?
When I press just enter key in mat field or press mouse button first at mat field and then at next field it gives message 'Material must be entered.' This is fine.
But when I press special characters like +, -, *, $ etc in mat field and then press enter key, it does not give any message and moves to next field. This is not fine sir.
Thanks and regards,
Vikas
acoder 16,027
Recognized Expert Moderator MVP
Use match in place of test.
hsriat 1,654
Recognized Expert Top Contributor
Use match instead of test. test is for regExp object while match is for string object. And you have a string object. ( link)
hsriat 1,654
Recognized Expert Top Contributor
Got late while searching for the link :D
Use match instead of test. test is for regExp object while match is for string object. And you have a string object. (link)
Yes Sir,
It is now working well.
Thanks and regards,
Vikas
acoder 16,027
Recognized Expert Moderator MVP
Yes Sir,
It is now working well.
If you'd tested on Firefox or a non-IE browser, you would've seen an error message, "mat.value. test is not a function", which would've given you a clue. Anyway, glad it's now working for you.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: FabFreddy |
last post by:
Hi,
I can't find out what the problem is with the error message below! I get it
when I go from one to another page with controls in these pages.
Anyone knows???
THX
Unable to validate data.
Description: An unhandled exception occurred during the execution of the
|
by: Amy |
last post by:
Hi,
I'm suddenly getting this error when I post back from my application.
the application worked once, i added some code on one page
(customizing a datagrid), and suddenly I'm getting this exception even
on a completely separate page (that worked before and that I haven't
changed). Page 1 has a Response.Redirect that goes to Page 2 (which
has the changes), but I get the error even if I trigger a postback
event on Page 1 and Page 2...
|
by: Peter O'Reilly |
last post by:
I receive the following error when I post a webpage:
"Unable to validate error" - System.Web.HTTPException.
The web page is an ASP WebForm page. I have a few controls on the page
that when selected (e.g. ASP.NET calendar control, HTML radio/option
buttons), a postback occurs.
In addition, I have a input button, that when clicked, initiates a HTTP Post
Request.
Notably the input button utilizes client side javascript to change the
|
by: sjl |
last post by:
I've got an .aspx webform for searching my database. It basically takes user
input and passes it as a parm into a stored proc to search a table. The
results are returned in a SQLDataReader and bound to a datagrid on the same
page. It works 90% of the time as expected. However, for some unknown
reason, I randomly get the error below. The HttpException says there is an
'Invalid_Viewstate'. Ok, but why? I'm posting back to the same page. If...
|
by: BuddyWork |
last post by:
Hello,
When setting the Web Gardens to 3 and I start browsing one of my
asp.net page I get the following error shown below. I don't get the
error when I set the Web Gardens to 1. Please note that I'm using
Windows 2003 Server with .Net Framework 1.1 SP1.
Error:
| |
by: Mike Fellows |
last post by:
running IIS on a single server, hosting pages on an intranet basis,
one single user out of 50 is having an unable to validate data issue
how do i fix this (the microsoft KB is a little inconclusive) ?
cheers
mark
this is the error message
|
by: Solje |
last post by:
Im developing an ASP.NET application used for maintinance purpose and
it may be idle for some ours. The application crash with the error
shown below when the user click on some contol in the appliaction.
This crash occurs on every clients at same time, event for the client
at the local server. I added some logging to the Application_Error
method that contains following:
Exception of type System.Web.HttpUnhandledException was thrown.
at...
|
by: inamul |
last post by:
Hi Guys,
I am am trying to validate multiple check box. It works fine when checkbox name is like chkSectionInterested but when i add to the name chkSectionInterested, then i can validate any more.
I need to keep so that i can save data using php collected from this page.
If i remove from checkbox name then php only gets last selected value from the check box please help. I have been looking for two days but nothin seems to work.
...
|
by: irfanshariffa |
last post by:
<html>
<head>
<script type="text/javascript" language="javascript">
function validate()
{
if (document.form.fname.value=="")
{
alert("Enter your Name");
document.form.fname.focus();
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |