Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > HTML > HTML Code Clinic
|
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 27th, 2005, 11:45 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 141
Thanks: 1
Thanked 0 Times in 0 Posts
Default Similar to the PROPER function in EXCEL

Hi All,

I have a data in a field with everything in CAPS.
For example: "MAKE RESERVATION"

What I am trying to display is the following;
"Make Reservation". Keep the first initial of each word in CAPS and the rest in LOWER CASE.

Thanks for your help,
:)

MCinar

Love all the creatures because of the creator.
__________________
MCinar

Love all the creatures because of the creator.
 
Old March 28th, 2005, 10:21 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Some browsers support the css style
Code:
 text-transform: capitalize
--

Joe (Microsoft MVP - XML)
 
Old March 28th, 2005, 11:39 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 141
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Thank you, Joe.

MCinar

Love all the creatures because of the creator.
 
Old March 28th, 2005, 11:47 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 141
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi Joe,

I tried the following code in IE 6.0, but it didn't work.
<%@ language="vbscript"%>
<% dim strVal
    strVal = "THIS IS A TEST"%>

    <SPAN STYLE="text-transform: capitalize;"><%=strVal%></SPAN>


Thanks for your help,

MCinar

Love all the creatures because of the creator.
 
Old March 28th, 2005, 12:01 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 425
Thanks: 0
Thanked 3 Times in 3 Posts
Default

AFAIK it works as advertised in IE6. What was the input and how did it turn out? Your variables don't really tell us anything.

If you for instance have a string that's all uppercase you won't see any effect.



(o<
//\ =^..^=
 
Old March 28th, 2005, 12:32 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 141
Thanks: 1
Thanked 0 Times in 0 Posts
Default

INPUT --- StrVAL = "THIS IS A TEST"
OUTPUT -- "THIS IS A TEST"

It didn't make it like "This Is A Test"

Thanks,


MCinar

Love all the creatures because of the creator.
 
Old March 29th, 2005, 09:03 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Capitalize just makes each starting letter a capital, it ignores other letters so you need:
Code:
<% dim strVal
    strVal = "THIS IS A TEST"%>
    strVal = LCase(strVal)
    <SPAN STYLE="text-transform: capitalize;"><%=strVal%></SPAN>
--

Joe (Microsoft MVP - XML)
 
Old March 29th, 2005, 12:34 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 141
Thanks: 1
Thanked 0 Times in 0 Posts
Default

It is very helpful.
Thanks, Joe.

MCinar

Love all the creatures because of the creator.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert text from excel to proper date in access bprodman Access VBA 1 June 18th, 2007 03:48 PM
Excel 2003 VBA Function RollingWoodFarm Excel VBA 15 August 2nd, 2006 04:24 PM
Calculating numbers of days similar to Excel klott16 Access 7 January 3rd, 2006 02:43 PM
^ function in excel rubydid Forum and Wrox.com Feedback 1 August 31st, 2005 08:10 AM
Is there a similar .epl file function in .NET Jongo VS.NET 2002/2003 2 February 12th, 2004 06:38 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.