You are here: Re: using forms to add records to mysql database - block submit on entering « HTML « IT news, forums, messages
Re: using forms to add records to mysql database - block submit on entering

Posted by BootNic on 09/06/07 15:57

dirk <dirkheld@gmail.com> wrote:
news:1189088174.396420.267840@y42g2000hsy.googlegroups.com:

> Hey,
> I'm new to php(and HTML) and I'm trying to write some php code so that
> I can insert data into a mysql database using html forms.
>
> I've got two text forms and a submit button. When entering data and
> selecting 'submit' a new record in my database is created. So far so
> good... But when I enter data in only one content and hit the enter
> key a new record is created with one empty field. And that something
> I don't want to happen.

URL? Create an example and supply a url. Need a host for your example?

Free host with mysql, php, no adds:

[url] http://www.leadhoster.com/signup.html [/url]
[url] http://www.zendurl.com/register.html [/url]

> Is there a way to block the text-forms so only a record is added when
> I hit the 'submit' button?

Form validation may be what you're looking for.

Client side validation using javascript, not dependable but may save a trip
or two to the server and for the ones that do not have javascript disable,
a convenience.

With or without client side validation, use server side validation. Google
is your friend. Search for it.

After you have searched and created an example, if you still need help post
to an appropriate newsgroup.

For client side form validation perhaps comp.lang.javascript, for php form
validation perhaps comp.lang.php.

FYI: Providing an example url and knowing the question to ask will make a
difference, and may prevent you being bounced from group to group.

--
BootNic Thursday September 6, 2007 11:56 AM
The more you find out about the world, the more opportunities there
are to laugh at it.
*Bill Nye*
*Mel Brooks*

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация