| |
|
If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
|
 |

11-08-02, 13:24
|
|
Registered User
|
|
Join Date: Nov 2002
Posts: 8
|
|
|
How do I make the first letter of a word capitalized?
|
|
This is what i want to do:
Make the months show like "January" instead of "january", or rather in Swedish "Januari".
is there a possibility to do something similar to the javascript toUpperCase(); ??
but I don't want the entire word to be in capitals, just the first letter...
i think this is tricky...
(but i know there's probably some feature that does this in a jiffy, there usually is)
Anyone got any ideas?
|
|

11-09-02, 13:04
|
|
Registered User
|
|
Join Date: Feb 2002
Posts: 2,232
|
|
Basically, you have to make your own. In vbscript, just ucase(left(x,1)) & right(x,len(x) - 1).
Let me know if you need this for javascript.
|
|

11-09-02, 20:51
|
|
Registered User
|
|
Join Date: Nov 2002
Posts: 8
|
|
|
|
you don't think that you could help me with this? where should i put this code? i'm pretty stupid you know...
|
|

11-09-02, 22:50
|
|
Registered User
|
|
Join Date: Feb 2002
Posts: 2,232
|
|
How often do you need this code ? What language do you need it in ?
How many pages need this code ?
|
|

11-10-02, 06:03
|
|
Registered User
|
|
Join Date: Nov 2002
Posts: 8
|
|
The scripts are in VBScript (i think, whatever the default language is, you see, i "stole" this script from a free scripts site), and i need it in two pages. Also I'd like to change the order of the date from "november 8" and so it looks like "8 November" when everything is applied...
Very much appreciated!
/Stephan
|
|

11-10-02, 21:32
|
|
Registered User
|
|
Join Date: Feb 2002
Posts: 2,232
|
|
Where are you pulling the dates from ?
|
|

11-11-02, 04:45
|
|
Registered User
|
|
Join Date: Nov 2002
Posts: 8
|
|
Everything is pulled from an access dB, but i suppose that the <%=MonthName(nextMonth)%> defines what month to print out, however, I can't find this MonthName anywhere in the script or the dB except for when it's called upon in the HTML. This must mean it's a built-in thing, right? Then how do I change how it's printed to the HTML? where should I put that (ucase...) that you showed me?
|
|

11-14-02, 23:24
|
|
Registered User
|
|
Join Date: Feb 2002
Posts: 2,232
|
|
Sorry for the delay... the MonthName is a vbscript function ... It depends on where you want to show the proper case. So in your example you could use the following:
<%= ucase(left(monthname(nextMonth),1)) & right(monthname(nextMonth),len(monthname(nextmonth )) -1)%>
|
|

11-15-02, 06:21
|
|
Registered User
|
|
Join Date: Nov 2002
Posts: 8
|
|
Thank You!
everything worked out fine,
but as always, there's a "but"...
when I tried to apply that same code string to:
<%=MonthName(Month(request("date")))%>
i got an error saying "can't use parethesis when calling a Sub"...
so...
u think you can help me out fixing this one too?
thanks!
/steph
|
|

11-16-02, 23:16
|
|
Registered User
|
|
Join Date: Feb 2002
Posts: 2,232
|
|
What is the exact code you are using ?
|
|

11-16-02, 23:51
|
|
Registered User
|
|
Join Date: Nov 2002
Posts: 8
|
|
<%= ucase(left(MonthName(Month(request("date"))),1)) & right(MonthName(Month(request("date")))),len(Month Name(Month(request("date"))))) -1)%>
or
<%= ucase(left(MonthName(Month(request("date")), true),1)) & right(MonthName(Month(request("date")), true)),len(MonthName(Month(request("date")), true))) -1)%>
depending on where and and how..., but if i could get one of these to work, the other would too...
thanks!
/steph
|
|

11-17-02, 00:28
|
|
Registered User
|
|
Join Date: Feb 2002
Posts: 2,232
|
|
The problem with both statements is the 2nd half of the statement. You need to count your parenthesis and you will see that there is a problem.
For example:
<%= ucase(left(MonthName(Month(request("date"))),1)) &
right(MonthName(Month(request("date"))),
len(MonthName(Month(request("date")))) -1)%>
Test it out and let me know.
|
|

11-17-02, 13:14
|
|
Registered User
|
|
Join Date: Nov 2002
Posts: 8
|
|
okay, you got me...
i've worked it out... had my parenthesis f-ed up, but now they're just fine
Thanks for all your help.
Now I know were to turn if something else turns up.
/steph
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|