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

Capitalization of web form input

Hi,

I'm using PHP to submit form input to MySQL and need a way to
capitalize the first character for certain fields. Does anyone know of
some way to achieve this?

Much appreciated
Jul 17 '05 #1
5 6190

"icrash2" <no*****@mxmoto.com> wrote in message
news:82**************************@posting.google.c om...
Hi,

I'm using PHP to submit form input to MySQL and need a way to
capitalize the first character for certain fields. Does anyone know of
some way to achieve this?

Much appreciated

ucwords() should do it...

http://ca.php.net/manual/en/function.ucwords.php
Jul 17 '05 #2
Hello,

On 12/29/2003 01:36 AM, icrash2 wrote:
I'm using PHP to submit form input to MySQL and need a way to
capitalize the first character for certain fields. Does anyone know of
some way to achieve this?


There is a function in PHP for doing that, but you may also want to take
a look at this class that among many other features of interess in form
generation and validation, it lets you specify capitalization rules: all
lowercase, all uppercase and just word initials (as you want).

The point of using this class for that purpose is that, besides doing it
on the server side, it will also capitalize the field values on the
client side (Javascript) right when the user changes them, so the user
can see that the form is capitalizing the words that are entered before
processing them.

http://www.phpclasses.org/formsgeneration
--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

Jul 17 '05 #3
no*****@mxmoto.com (icrash2) wrote in message news:<82**************************@posting.google. com>...
Hi,

I'm using PHP to submit form input to MySQL and need a way to
capitalize the first character for certain fields. Does anyone know of
some way to achieve this?

Much appreciated

ucfirst() uppercases first letter in a string
ucwords() uppercases firtw letter of every word in string
Mike Bradley
http://gzen.myhq.info -- free online php tools
Jul 17 '05 #4
I noticed that Message-ID:
<ed**************************@posting.google.com > from CountScubula
contained the following:
I'm using PHP to submit form input to MySQL and need a way to
capitalize the first character for certain fields. Does anyone know of
some way to achieve this?

Much appreciated

ucfirst() uppercases first letter in a string
ucwords() uppercases firtw letter of every word in string


But as someone pointed out in a recent thread, for names this may not be
what you want e.g. van Damme, de Werke..
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #5
Geoff Berrow <bl******@ckdog.co.uk> wrote in message
news:eb********************************@4ax.com...
I noticed that Message-ID:
<ed**************************@posting.google.com > from CountScubula
contained the following:
I'm using PHP to submit form input to MySQL and need a way to
capitalize the first character for certain fields. Does anyone know of
some way to achieve this?

Much appreciated

ucfirst() uppercases first letter in a string
ucwords() uppercases firtw letter of every word in string


But as someone pointed out in a recent thread, for names this may not be
what you want e.g. van Damme, de Werke..
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/


Use explode() to turn the string into an array, then capitalize each word
that doesn't match "van" "de" etc using a loop.
Jul 17 '05 #6

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

Similar topics

4
by: Eric | last post by:
Hey Everyone.. I have a form that has approximately 7 text fields and 1 checkbox. Generally when this form is submitted(to itself BTW) it works fine, however, when the checkbox is only field...
2
by: Nick | last post by:
Loop to create an array from a dynamic form. I'm having trouble with an application, and I'll try to explain it as clearly as possible: 1. I have a form with two fields, say Apples and...
0
by: Agoston Bejo | last post by:
Tools / Options / Text Editor / HTML/XML / Format / Capitalization Usually I use Tags: Uppercase; Attributes: Uppercase but now I edit XML pages and I set them both to "As entered". However,...
4
by: pizzy | last post by:
INTRO: I tried to clean it up for easy reading. I hope I didn't make any mistakes. PROBLEM: WOW, this is some crazy sh!t. I can't get my checkbox (see "TAGSELECTED") to print my textboxes (see...
6
by: Corepaul | last post by:
I am new to Access 2000. My operating system is Windows 2000. In the early stage of development I noticed something weird. On my form, I have a Command Button named "btnAlbumUp". The first time...
1
by: AA Arens | last post by:
To have the first character of a fiels capitalized AfterUppdate, I used the following script: Me!City = UCase$(Left$(Me!City, 1)) + Mid$(Me!City, 2) UCase (Left(Me!City, 1)) + Mid(Me!City, 2) ...
5
by: Bruce W.1 | last post by:
Looking at the html produced by Visual Studio I see a mixed bag of tag capitalization. For example there's <HEAD> and <body>. Then there's <form and <TABLE>. Is there some logic behind the mixed...
5
jimleon
by: jimleon | last post by:
Hello gurus I have a text box on a form that is used to enter data in the format a99v which is bound to a table. How do I auto capitalize the form field and the entry in the table. Thought it was...
0
bmallett
by: bmallett | last post by:
First off, i would like to thank everyone for any and all help with this. That being said, I am having a problem retrieving/posting my dynamic form data. I have a form that has multiple options...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.