Hi all,

I have had a look around the forum but cannot find an answer to my question.

I want to capitalise the first letter of each word a user inserts into a form before the data is written to the database.

If I have a form with an input filed like.

<input name="title" type="text" class="bodytext" value="{$smarty.request.title|escape|capitalize}" size="15" />

how do I use ucfirst within the form input field line of code.

    assuming your form is using the POST method:

    $title = ucfirst($_POST['title']);
    

    then stick $title in your db

      If, as you state, you want to capitalize each word, then use [man]ucwords/man.

        Write a Reply...