Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

Required items in a form

 

 

Python python RSS feed   Index | Next | Previous | View Threaded


deanfamily11 at verizon

Jul 1, 2008, 3:20 PM

Post #1 of 4 (179 views)
Permalink
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?


--
http://mail.python.org/mailman/listinfo/python-list


benjamin.kaplan at case

Jul 1, 2008, 4:23 PM

Post #2 of 4 (174 views)
Permalink
Re: Required items in a form [In reply to]

On Tue, Jul 1, 2008 at 6:20 PM, Brandon <deanfamily11 [at] verizon> wrote:

> 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 GUI toolkit are you using?

>
> --
> http://mail.python.org/mailman/listinfo/python-list
>


hat at se-162

Jul 2, 2008, 12:43 AM

Post #3 of 4 (173 views)
Permalink
Re: Required items in a form [In reply to]

On 2008-07-01, Brandon <deanfamily11 [at] verizon> wrote:
> 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
--
http://mail.python.org/mailman/listinfo/python-list


timr at probo

Jul 3, 2008, 10:31 PM

Post #4 of 4 (166 views)
Permalink
Re: Required items in a form [In reply to]

"Brandon" <deanfamily11 [at] verizon> wrote:
>
>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, timr [at] probo
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list

Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.