473,397 Members | 1,949 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

validation, before_update and after_update

I'd like to have validation of the inputted text, in a form textbox. I
want to give the user the option to try again, or to cancel out after
which the textbox is either cleared or restored. I just don't succeed.

In the before_update event, I can cancel out the change, after which the
input box keeps the focus. Fine. But I can't change the value for the
input box in case he wants to cancel out, it gives an error.

I can restore or clear the input box in the after_update event, but I
can't keep the focus on the textbox. Event setfocus() doesn't help.

What must I do? I threw something together that can set Cancel to true
in before_update, but I have to check again in after_update to allow the
user to wipe the field after giving up. I effectively must check the
validation twice, which is annoying if the validation routine pops up a
msgbox informing the user of the error; or, must I set a global variable
in before_update to check in after_update? Ugly!

--
Bart.
Nov 13 '05 #1
2 3353
Bart Lateur wrote:
I'd like to have validation of the inputted text, in a form textbox. I
want to give the user the option to try again, or to cancel out after
which the textbox is either cleared or restored. I just don't succeed.

In the before_update event, I can cancel out the change, after which
the input box keeps the focus. Fine. But I can't change the value for
the input box in case he wants to cancel out, it gives an error.

I can restore or clear the input box in the after_update event, but I
can't keep the focus on the textbox. Event setfocus() doesn't help.

What must I do? I threw something together that can set Cancel to true
in before_update, but I have to check again in after_update to allow
the user to wipe the field after giving up. I effectively must check
the validation twice, which is annoying if the validation routine
pops up a msgbox informing the user of the error; or, must I set a
global variable in before_update to check in after_update? Ugly!


Either leave the entry for the user to clear with the <Escape> key or use
....

Me.ControlName.Undo

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #2
Rick Brandt wrote:
Me.ControlName.Undo


Perfect. Works fine in before_update, and allows the focus to move on to
the next textbox.

--
Bart.
Nov 13 '05 #3

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

Similar topics

21
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...
6
by: Hernán Castelo | last post by:
should i to validate all the "Request"s calls like Request.FORM("...") and Request.Cookies("...") ???? if it is so, i have to see inside every "Input" elements like "Text" and even "Hidden"...
2
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...
4
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. ...
41
by: Gérard Talbot | last post by:
Cross-posted to: comp.infosystems.www.authoring.html and alt.html Followup-to: comp.infosystems.www.authoring.html 1- One day, I stumbled across a website that offers to validate webpages. What...
16
by: Hosh | last post by:
I have a form on a webpage and want to use JavaScript validation for the form fields. I have searched the web for form validation scripts and have come up with scripts that only validate...
14
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)...
2
by: AricC | last post by:
When is the best time to run a validation check? I've read some places to do the check on the forms before_update command, however does this work if you've hard the coded the inserts on a custom...
2
by: maxx429 | last post by:
Hi all, I am a VBA newb. I know probably just enough to be dangerous. :) Anyway, I have a Form that I am using <a href="http://allenbrowne.com/AppAuditCode.html">Allen Brown's Audit Trail</a> ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
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...
0
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...
0
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,...
0
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...

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.