473,386 Members | 1,674 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,386 software developers and data experts.

Required items in a form

What I'm trying to do is essentially force a user to fill in required items
in a form, which will be saved to a database. How can I get it so that once
the user clicks "OK" on the dialog box, it transfers control back to the
form, and not save the empty fields into the database?
Jul 1 '08 #1
2 982
On 2008-07-01, Brandon <de**********@verizon.netwrote:
What I'm trying to do is essentially force a user to fill in required items
in a form, which will be saved to a database. How can I get it so that once
the user clicks "OK" on the dialog box, it transfers control back to the
form, and not save the empty fields into the database?
Follow the golden rule of not trusting user input.

When you get back values for the fields, check them, and if not correct, ask
again, give an error, abort the program, erase the data base, reboot the
system, whatever is appropiate to handle such an error.

Sincerely
Albert
Jul 2 '08 #2
"Brandon" <de**********@verizon.netwrote:
>
What I'm trying to do is essentially force a user to fill in required items
in a form, which will be saved to a database. How can I get it so that once
the user clicks "OK" on the dialog box, it transfers control back to the
form, and not save the empty fields into the database?
What do you mean by "transfers control back to the form"? A form doesn't
have any code, and so can't "control" anything.

Now, it is certainly possible to define an onSubmit handler in the <form>
header, then write a Javascript function that validates the input. If the
function returns false, the submit won't happen.
--
Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Jul 4 '08 #3

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

Similar topics

10
by: Craig Keightley | last post by:
I have the following array: function showCPUs(){ //name brandID dualCore dualProcessor var cpuItem=; var cpuItem=; var cpuItem=; var cpuItem=; var cpuItem=; var cpuItem=; var cpuItem=;
3
by: John | last post by:
Hi there - if anyone has a few spare minutes I could really do with some help please. I'm a student and have been given an exercise using MS Access to design a simple database for a fictional...
3
by: Paul W | last post by:
I have a ListBox Webcontrol with an OnSelectedIndexChanged event (and AutoPostBack=true). If I disable EnableViewState for this control, when I change the listbox index, the form does a postback...
3
by: Holmes | last post by:
Hello Ran into a bit of a problem here and have now exhausted my resources to getting this working What I am trying to do is load and show a simple vb form with a listbox in it Dim...
7
by: Mike P | last post by:
I am trying to write my first program using threading..basically I am moving messages from an Outlook inbox and want to show the user where the process is up to without having to wait until it has...
1
by: KMEscherich | last post by:
Using Access '97 Hi there, am wondering if there is a way to have a CLOSE button on the form and have it NOT CLOSE the form unless all the REQUIRED controls have an entry. I have 3 items I...
2
by: Peter | last post by:
Hi, I have a problem with Listview using checkboxes. If i check items by code BEFORE the form is shown the Listview.Items are confused during the ItemChecked Event !!! After showing the...
2
by: Dave | last post by:
The problem is with my listbox on the form. I am trying to run 2 threads simulataneously an update two different listbox controls but my functions are complaining that the listbox doesn't have an...
5
by: BlackBox | last post by:
I have a Listbox1 in the main form and I can add listbox1 items in the parent form. But when I close the parent form Listbox1 in the main form does not get refresh. I need to re-open the app. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.