SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2003
    Location
    Anywhere
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    force someone to write in capitals

    Here is the CSS script

    <input type="text" name="Name" style=" text-transform: uppercase;">

    My problem is that the text written inside the above text field is stored lowercase in my database (Mysql) using php.

    Do you know what cause this problem. Does CSS transform completely the text into capitals or not?

  2. #2
    SitePoint Zealot Pozor's Avatar
    Join Date
    Apr 2004
    Location
    Switzerland
    Posts
    114
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    IMHO is css only to style your content. try a php functin like:

    string strtoupper ( string string)

    these will work for you.

    greez Pozor

  3. #3
    SitePoint Enthusiast
    Join Date
    Apr 2003
    Location
    Anywhere
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It want some script to turn the CapLock On and i thought that CSS was the best but i am quite wrong.

  4. #4
    Caveat surfer Buddy Bradley's Avatar
    Join Date
    May 2003
    Location
    Cambridge, UK
    Posts
    2,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The only way to accomplish what you seem to be trying to do is have a Javascript run onChange in the input box which changes any lowercase characters to uppercase ones. But Pozor has a better idea - just change the case at the point you insert the text into the database.

  5. #5
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,236
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Yeah, text-transform only affects how the user input is displayed, not how it is sent to the server. Use the strtoupper() PHP function once you're about to insert the input into the database.

  6. #6
    Also available in Large Si's Avatar
    Join Date
    Sep 2002
    Location
    Walsall, UK
    Posts
    1,911
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Or if you're using ASP UCASE(string)
    Si
    Are you a Photoshop Jedi Master? Prove it!

    Is funky house your bag? You'll love this!

    Voice
    , eyes, ears, body and hands.


  7. #7
    SitePoint Enthusiast
    Join Date
    Apr 2003
    Location
    Anywhere
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your response. I fixed as you mentioned.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •