简体   繁体   中英

text-transform doesn't work with post form submit php

I have an input which I added the uppercase style for it as shown below:

style="text-transform: uppercase"

However, the text is not sent as upper via the post (after pressing the submit button) as shown below:

$_POST['_mytext']

I can use the upper case function in php, but I am wondering why the post is not getting the correct uppercase for the value? Is there is anything wrong with my html?

Styling is purely visual.

Here is an ultra-simple demonstration .

<span style="text-transform: uppercase">test</span>

In this case, TEST is printed to screen in accordance with the styling.

However, if you inspect the element, the source code will still read test .

Furthermore...

If you run the following javascript conditionals:

if(document.getElementById('demo').innerHTML=='test'){
   alert('lowercase');
}
if(document.getElementById('demo').innerHTML=='TEST'){
   alert('UPPERCASE');
}

You will only see the lowercase alert. This is because the actual data isn't changed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM