how to automatic text in a textbox all uppercase? – PHP

  php

Q(Question):

hi i’m just wondering on how can i make all the type text in my textbox all uppercase using php? tnx Alot..

A(Answer):

You can’t do it in PHP since that’s server side. You’ll have to use javascript. Use the onkeyup event to change the value to upper case.

A(Answer):

hi rabbit can you give me an example code bout it…thanks

A(Answer):

Sorry, I don’t give out code unless the poster has shown an attempt at the solution.

A(Answer):

Well, I will give you a tips but you will have to figure out rest:
if char is lower case then
char=char-(‘a’-‘A’);

you can make it simpler

A(Answer):

well actually already made a code bout it here it is

<?php
$origin =$_GET['txtpickup'];
$word = "$origin";
$word = strtoupper($word);
echo "$word";
?>

the problem is i can make it uppercase during the form is submitted..what i really want is when the word is type in my textbox in the first form it will change to uppercase..and i cant find a way to do it without using a jquery or javascript..

A(Answer):

Like I already said, you must use javascript. By the way, jquery is just a javascript library, it’s still javascript. Technically you can also use VBScript but that will only work on IE. And you can use ActionScript if you use Flash. I only mention them for completeness’ sake. Your best option is javascript.

LEAVE A COMMENT