473,578 Members | 3,177 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Validation

Hallo,

ich habe folgenden Java-Code in eine ASP-Schleife eingebunden.
Es steht ein Textfeld zu Verfügung in welchem der User eine Ganzzahl
von
<%=prrs("VonMen ge")%> bis <%=prrs("BisMen ge")%> eingeben kann.

Nun zum Problem:
Darf der User eine Zahl zwischen z.B. 1 und 12 eingben funzt das
Script
bei 1,10,12,13, etc. und überträgt die Zahl an eine andere Seite.
Bei 2,3,4,5,6,7,8,9 erhalte ich

alert("Die eingegebene Menge ist in diesem Feld nicht möglich!");
theForm.MENGE<% =prrs("SKINARTN ")%>.focus( );
return (false);

Kann jemand helfen? Gerne auch an ai@kts.de

Danke + Gruss
Aleksandar


<script Language="JavaS cript" Type="text/javascript"><!--
function thisForm_<%=prr s("SKINARTN")%> _Validator(theF orm)
{

}
var chkVal = theForm.MENGE<% =prrs("SKINARTN ")%>.value;
var prsVal = chkVal;
if (chkVal != "" && !(prsVal >= "<%=prrs("VonMe nge")%>" && prsVal <=
"<%=prrs("BisMe nge")%>"))
{
alert("Die eingegebene Menge ist in diesem Feld nicht möglich!");
theForm.MENGE<% =prrs("SKINARTN ")%>.focus( );
return (false);
}

}
//-->
</script>
Jul 23 '05 #1
1 1225
Aleksandar wrote:
Nun zum Problem:
Darf der User eine Zahl zwischen z.B. 1 und 12 eingben funzt das
Script
bei 1,10,12,13, etc. und überträgt die Zahl an eine andere Seite.
Bei 2,3,4,5,6,7,8,9 erhalte ich

alert("Die eingegebene Menge ist in diesem Feld nicht möglich!");


You should rather use news:de.comp.la ng.javascript if you want to ask
questions in german language.

For a solution of your problem see the FAQL of dcljs:
http://dcljs.de/faq/antwort.php?Antw...en_vergleichen

Short summary: Comparision operators do compare lexically if one operand
is of type 'string'. Form field values are of type 'string'.

Xpost & F'up2 dcljs.

ciao, dhgm

Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
3897
by: Stefan Richter | last post by:
Hi, after coding for days on stupid form validations - Like: strings (min / max length), numbers(min / max value), money(min / max value), postcodes(min / max value), telefon numbers, email adresses and so on. I thought it might be a better way to programm an automated, dynamic form validation that works for all kinds of fields, shows the...
2
2138
by: wumingshi | last post by:
Hi, When validating an XML instance, sometimes the schema is not enough to expression the validation rules. Additional validation rules may be expressed in an application-specific way. For example, using XPath or Java method. So is there a concept and/or standard for post-schema validation or application validation? Is there any hook in XML...
4
2605
by: Tim Meagher | last post by:
I am trying to use both validation controls and to add submit button attributes, but when I add the button attributes, the javascript fpr the validation controls is no longer created for the page. How can I use both? Thank you, Tim Meagher
14
6281
by: Matt | last post by:
I want to know if ASP.NET Web Forms Validation Controls are Server-Side or Client-Side form validation? Since I think each validator control can select either 1) JavaScript based error dialog or 2) show the error message next to the control. For example, if the text field is empty with RequiredField Validator control, it can show the value in...
6
2407
by: Stephen | last post by:
Hi, the validation controls dont work on Netscape or Mozilla and only on Internet Explorer why? How do i correct this problem? Thanks
7
2037
by: Ryan Ternier | last post by:
We're running a site that has required field validation on the login page. It works fine on our development / test machines. However, when I upload this site to our live server i get this error. In IE, the validation works, but no form ever gets submited. It doesn't even process the click event of the button. In mozilla, it works 100% (this...
5
3233
by: Chris | last post by:
Based upon some prevoius postings on what to do for adding a 'add' row to a datagrid I utilize the footer to create the 'add' row. The only issue is that I have it sharing the 'UpDate_Command' and I use an argument to difference between an 'edit' vs. and 'add. But since I have field validation on both 'footer' and 'edit' columns I can't submit...
4
2963
by: David Colliver | last post by:
Hi all, I am having a slight problem that hopefully, someone can help me fix. I have a form on a page. Many items on the form have validation controls attached. Also on this form are linkbuttons which must not cause validation. I have found a setting "causeValidation" to disable the validation. Also on the page, I have a datagrid that...
2
4503
by: dustbort | last post by:
I recently had a problem where my required field validator stopped working. But, the page still posted back and tried to insert a record into the database without performing server-side validation. I discovered that there was no aspnet_client folder in the root of my IIS Web site, and when I ran "aspnet_regiis -c", client-side validation was...
6
3349
by: Jon Paal | last post by:
validation doesn't fire what's missing ????? /////// ---- code -----/////////////////////////// Sub btnSubmit_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) 'Handles btnSubmit.Click If page.isValid then ..... end if
0
7778
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...
0
8125
Oralloy
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. ...
0
8148
tracyyun
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...
0
6522
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5664
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5342
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...
0
3781
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...
1
2292
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1389
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.