473,770 Members | 4,443 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with validation of field

Hi,
I have a field that requires validation when you press a button as
follows:
<form name="form_affi che" enctype = "multipart/form-data"
method="get">
.....
<td width="80"><inp ut type="Button" name="submitBut ton"
value="Modifier " tabindex="3" onClick="if(isV alid())
{document.form_ affiche.action= 'order.php';doc ument.form_affi che.submit();}r eturn
false;"></td>
.....
</form>
The validation works perfectly when the button is pressed. However,
should the user enter an invalid number and press ENTER as opposed to
the button "Modifier", then the invalid number is taken into
consideration.

Thank you in advance for any suggestion or solution.
Kind regards
Bilal
Jul 20 '05 #1
1 1128

maybe change your javascript to the form's onSubmit
versus button's onclick .. and make the input type submit for the
button ... this way pressing enter or the button would activate the
submit procedure?

Brynn
www.coolpier.com

On 23 Jan 2004 21:34:52 -0800, bj****@hotmail. com (Bilal) wrote:
Hi,
I have a field that requires validation when you press a button as
follows:
<form name="form_affi che" enctype = "multipart/form-data"
method="get" >
....
<td width="80"><inp ut type="Button" name="submitBut ton"
value="Modifie r" tabindex="3" onClick="if(isV alid())
{document.form _affiche.action ='order.php';do cument.form_aff iche.submit();} return
false;"></td>
....
</form>
The validation works perfectly when the button is pressed. However,
should the user enter an invalid number and press ENTER as opposed to
the button "Modifier", then the invalid number is taken into
consideratio n.

Thank you in advance for any suggestion or solution.
Kind regards
Bilal


Brynn
www.coolpier.com

I participate in the group to help give examples of code.
I do not guarantee the effects of any code posted.
Test all code before use!
Jul 20 '05 #2

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

Similar topics

3
2782
by: TekWiz | last post by:
I've got a system that automatically generates a form. I have it set up so that the backend will return to the inital form page with an error object in sessions data (assuming the backend detected invalid data or required fields not filled in) and the frontend will generate an initial value of items WITHOUT errors (so the user doesn't have to reenter valid info). This is the problem. The frontend generates the initial value attribute...
5
9724
by: Alex M | last post by:
I'm trying to use the jakarta struts client side javascript validators and the validators are working, but they are not showing the popup messages. I have the message keys defined in the ApplicationResources.properties file, the propertise file is in the right location, it is referenced from the struts-config.xml, but still no messages. For example, submitting a form that violates the required field validator, just causes it to do...
5
2610
by: EviL KerneL | last post by:
Hi - I am trying to figure out a way to enforce the validation included for this form based on whether the user chooses "email" or "phone" as the contact choice. Right now it is set to enforce validation on both. Is there a way to link the drop-down choice to the correspondent validation section while disabling validation for the other one? here's what I presently have:
2
10420
by: Doslil | last post by:
I am trying to validate the fields in my database.I have already validated the fields to check for not null.Here is what I have written for Numeric and text field. Private Function EENUM() On Error GoTo EENUMErr If IsNull(Me.EmployeesID) Or Me.EmployeesID = "" Or Me.EmployeesID < 0 Then MsgBox "Employee Number Cannot Be Left Blank", vbOKOnly, "Employee Number"
7
736
by: Mathew Hill | last post by:
I am a beginner to the more technical aspects of Microsoft Access (2000) and was wondering if any one can help? I have a field in a table called: ADMIN NUMBER This field should have 4 characters and ONLY NUMBERS should be inputted. Does anyone know what the validation rule should be for this field?
5
2422
by: Do | last post by:
Hi, Has anybody run into problems with Page.IsValid? My errors show up when the fields aren't filled correctly, but my processing continues even if the page is invalid. I leave name and description blank and I do get the error messages. But the code still continues to run the addfolder method from my class. Is there something wrong with this?
3
1448
by: aljodo | last post by:
ASP.Net v1.1 & vb.net Hi all, I have a simple survey form with first name/last name text boxes at the top. I have validators on these text boxes to ensure that something is entered in them. The form has a Submit button (asp:button) at the bottom and if the validation has failed I want the form to return to the top, so that the
18
1800
by: jslowery | last post by:
I am not completely knowledgable about the status of lexical scoping in Python, but it was my understanding that this was added in a long time ago around python2.1-python2.2 I am using python2.4 and the following code throws a "status variable" not found in the inner-most function, even when I try to "global" it. def collect(fields, reducer): def rule(record): status = True
5
1573
by: billa856 | last post by:
Hi, My project is in MS Access. In that one form of data entry I am using this code for validation of field. Private Sub CustomerCode_Combo_LostFocus() If Me.CustomerCode_Combo = "" Or IsNull(Me.CustomerCode_Combo) Then strMsg = "You must select Customer Code from the ComboBox." strTitle = "CustomerCode Required" intStyle = vbOKOnly MsgBox strMsg, intStyle, strTitle Me.CustomerCode_Combo.Undo
2
3014
by: swethak | last post by:
hi , i write the code in .htm file. It is in cgi-bin/searches/one.htm.In that i write a form submitting and validations.But validations are not worked in that .htm file. I used the same code in my local system that validations work.plz tell that whats the problem in that. Here is my code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html...
0
9439
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,...
0
10237
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10071
jinu1996
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...
1
10017
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,...
0
9882
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6690
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();...
0
5326
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...
0
5467
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3589
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.