I tend to prefer javascript solutions over CSS solutions myself but thats probably because I know more JS than CSS
but if you are going to rant about standards <b></b> is depricated use <Strong></Strong> as this is also recognised in speech enabled browsers and BTW the CSS will work in IE 5+ Matt ----- Original Message ----- From: "Christopher Dawes" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, August 18, 2004 2:00 AM Subject: RE: [ cf-dev ] OT: JS Bold first letter > Firstly the second half of the conversation related directly to what I > wrote. Go figure?? > > Secondly the CSS works in standards compliant browsers, which IE is not, so > a css solution won't work for most users. > > Thirdly, add a <b> and </b> tag to either script and you can Bold your first > letter instead.... > > Word for today: Lateral. > > Chris > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > Sent: Wednesday, 18 August 2004 3:31 AM > To: [EMAIL PROTECTED] > Subject: RE: [ cf-dev ] OT: JS Bold first letter > > > seems like a lot of work for what can be covered by one line of CSS. and > it doesn't do what Neil wanted. > > and yes, I have the Javascript Bible :-) > > > > > > > "Christopher > > Dawes" To: > <[EMAIL PROTECTED]> > <[EMAIL PROTECTED] cc: > > dawes.biz> Subject: RE: [ cf-dev ] OT: > JS Bold first letter > > > 17/08/2004 18:07 > > Please respond > > to dev > > > > > > > > > Please learn JavaScript!! All of you! Get Danny Goodman's JavaScript Bible > and put it on the shelf on your desk after reading it cover to cover. Do > yourselves a favour. Nearly all scripting languages (including CFSCRIPT and > Action script) are based closely on JavaScript... JSB is a dictionary for > JavaScript - ie you can look up what you want quickly and easily. > > I got so frustrated watching you try to use styles in Internet Explorer > that > I felt sorry for you and wrote these two scripts. If you haven't worked out > by now that IE is NOT standards compliant, then you need to wake up and > smell the coffee!! IE5+ is the new NS4, that is the bain of everyone's > existence; an over-patched piece of poo! > > <gets off soapbox> > > Here's the old fashioned way... ( ie: without using Regex ) I've made it > easy to read so that you can learn a little more about Javascript. > > The first function sets the first letter ONLY and the second function sets > the first letter of each word. > > <SCRIPT LANGUAGE="JavaScript"> > > function firstLetterCaps(string) { > partOne = string.substring(0,1); > partTwo = string.substring(1,string.length); > return partOne.toUpperCase() + partTwo.toLowerCase(); > } > > function firstCaps (string) { > lastSpace = -2; > outputString = ""; > for ( a=0; a<string.length; a++) { > thisLetter = string.substring(a,a+1); > if ( thisLetter == " " ) { > lastSpace = a; > } > alert(a + " : " + thisLetter ); > if ( a==0 || a == lastSpace+1 ) { > outputString += > thisLetter.toUpperCase(); > } > else { > outputString += > thisLetter.toLowerCase(); > } > } > return outputString ; > } > > </SCRIPT> > > <INPUT TYPE="text" NAME="thisField" VALUE="sweet" onBlur="this.value = > firstCaps(this.value);"> > > -----Original Message----- > From: Robertson-Ravo, Neil (RX) > [mailto:[EMAIL PROTECTED] > Sent: Tuesday, 17 August 2004 11:26 PM > To: '[EMAIL PROTECTED]' > Subject: RE: [ cf-dev ] OT: JS Bold first letter > > Yeah the caps works but it looks like its impossible to embolden the first > letter in an input field... > > > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > Sent: 17 August 2004 12:09 > To: [EMAIL PROTECTED] > Subject: RE: [ cf-dev ] OT: JS Bold first letter > > > the first one definitely works fine for me. never used the other one > before, so don't know why it doesn't work. > > > > > > > "Robertson-Ravo, Neil (RX)" > > <[EMAIL PROTECTED] To: > "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]> > dexpo.com> cc: > > Subject: RE: [ > cf-dev ] OT: JS Bold first letter > 17/08/2004 12:06 > > Please respond to dev > > > > > > > > > Neither seem to work....? > > > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > Sent: 17 August 2004 12:00 > To: [EMAIL PROTECTED] > Subject: RE: [ cf-dev ] OT: JS Bold first letter > > > this will capitalise the first letter of each word: > <input type="text" style="text-transform:capitalize"> > > I expect you could also use Mark's suggestion: > <input type="text" style="first-letter {font-weight: bold;}"> > > > > > > > "Robertson-Ravo, Neil (RX)" > > <[EMAIL PROTECTED] To: > "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]> > dexpo.com> cc: > > Subject: RE: [ > cf-dev ] OT: JS Bold first letter > 17/08/2004 11:58 > > Please respond to dev > > > > > > > > > Erm, don't think so, it's in a form field (more than one on the page) > > -----Original Message----- > From: Mark Smyth [mailto:[EMAIL PROTECTED] > Sent: 17 August 2004 11:52 > To: '[EMAIL PROTECTED]' > Subject: RE: [ cf-dev ] OT: JS Bold first letter > > Can you use css? > E.g. > <style> > p:first-letter {font-weight: bold;} > </style> > </head> > > <body> > <p> > This is a test > </p> > > -----Original Message----- > From: Robertson-Ravo, Neil (RX) > [mailto:[EMAIL PROTECTED] > Sent: 17 August 2004 11:47 > To: '[EMAIL PROTECTED]' > Subject: [ cf-dev ] OT: JS Bold first letter > > > Got a bit of a brain fuzz, anyone got any JS which will embolden the first > letter of a string being typed into a text field? > > N > > > This e-mail is from Reed Exhibitions (Oriel House, 26 The Quadrant, > Richmond, Surrey, TW9 1DL, United Kingdom), a division of Reed Business, > Registered in England, Number 678540. It contains information which is > confidential and may also be privileged. It is for the exclusive use of > the > intended recipient(s). If you are not the intended recipient(s) please > note > that any form of distribution, copying or use of this communication or the > information in it is strictly prohibited and may be unlawful. If you have > received this communication in error please return it to the sender or call > our switchboard on +44 (0) 20 89107910. The opinions expressed within this > communication are not necessarily those expressed by Reed Exhibitions. > Visit > our website at http://www.reedexpo.com > > -- > These lists are syncronised with the CFDeveloper forum at > http://forum.cfdeveloper.co.uk/ > Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ > > CFDeveloper Sponsors and contributors:- > *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided > by activepdf.com* > *Forums provided by fusetalk.com* :: *ProWorkFlow provided by > proworkflow.com* > *Tutorials provided by helmguru.com* :: *Lists hosted by > gradwell.com* > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > -- > These lists are syncronised with the CFDeveloper forum at > http://forum.cfdeveloper.co.uk/ > Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ > > CFDeveloper Sponsors and contributors:- > *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided > by activepdf.com* > *Forums provided by fusetalk.com* :: *ProWorkFlow provided by > proworkflow.com* > *Tutorials provided by helmguru.com* :: *Lists hosted by > gradwell.com* > > To unsubscribe, e-mail: [EMAIL PROTECTED] > This e-mail is from Reed Exhibitions (Oriel House, 26 The Quadrant, > Richmond, Surrey, TW9 1DL, United Kingdom), a division of Reed Business, > Registered in England, Number 678540. It contains information which is > confidential and may also be privileged. It is for the exclusive use of > the > intended recipient(s). If you are not the intended recipient(s) please > note > that any form of distribution, copying or use of this communication or the > information in it is strictly prohibited and may be unlawful. If you have > received this communication in error please return it to the sender or call > our switchboard on +44 (0) 20 89107910. The opinions expressed within this > communication are not necessarily those expressed by Reed Exhibitions. > Visit our website at http://www.reedexpo.com > > -- > These lists are syncronised with the CFDeveloper forum at > http://forum.cfdeveloper.co.uk/ > Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ > > CFDeveloper Sponsors and contributors:- > *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided > by activepdf.com* > *Forums provided by fusetalk.com* :: *ProWorkFlow provided by > proworkflow.com* > *Tutorials provided by helmguru.com* :: *Lists hosted by > gradwell.com* > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > > > > -- > These lists are syncronised with the CFDeveloper forum at > http://forum.cfdeveloper.co.uk/ > Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ > > CFDeveloper Sponsors and contributors:- > *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided > by activepdf.com* > *Forums provided by fusetalk.com* :: *ProWorkFlow provided by > proworkflow.com* > *Tutorials provided by helmguru.com* :: *Lists hosted by > gradwell.com* > > To unsubscribe, e-mail: [EMAIL PROTECTED] > This e-mail is from Reed Exhibitions (Oriel House, 26 The Quadrant, > Richmond, Surrey, TW9 1DL, United Kingdom), a division of Reed Business, > Registered in England, Number 678540. It contains information which is > confidential and may also be privileged. It is for the exclusive use of > the > intended recipient(s). If you are not the intended recipient(s) please > note > that any form of distribution, copying or use of this communication or the > information in it is strictly prohibited and may be unlawful. If you have > received this communication in error please return it to the sender or call > our switchboard on +44 (0) 20 89107910. The opinions expressed within this > communication are not necessarily those expressed by Reed Exhibitions. > Visit our website at http://www.reedexpo.com > > -- > These lists are syncronised with the CFDeveloper forum at > http://forum.cfdeveloper.co.uk/ > Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ > > CFDeveloper Sponsors and contributors:- > *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided > by activepdf.com* > *Forums provided by fusetalk.com* :: *ProWorkFlow provided by > proworkflow.com* > *Tutorials provided by helmguru.com* :: *Lists hosted by > gradwell.com* > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > > > > -- > These lists are syncronised with the CFDeveloper forum at > http://forum.cfdeveloper.co.uk/ > Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ > > CFDeveloper Sponsors and contributors:- > *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided > by activepdf.com* > *Forums provided by fusetalk.com* :: *ProWorkFlow provided by > proworkflow.com* > *Tutorials provided by helmguru.com* :: *Lists hosted by > gradwell.com* > > To unsubscribe, e-mail: [EMAIL PROTECTED] > This e-mail is from Reed Exhibitions (Oriel House, 26 The Quadrant, > Richmond, Surrey, TW9 1DL, United Kingdom), a division of Reed Business, > Registered in England, Number 678540. It contains information which is > confidential and may also be privileged. It is for the exclusive use of > the > intended recipient(s). If you are not the intended recipient(s) please > note > that any form of distribution, copying or use of this communication or the > information in it is strictly prohibited and may be unlawful. If you have > received this communication in error please return it to the sender or call > our switchboard on +44 (0) 20 89107910. The opinions expressed within this > communication are not necessarily those expressed by Reed Exhibitions. > Visit our website at http://www.reedexpo.com > > -- > These lists are syncronised with the CFDeveloper forum at > http://forum.cfdeveloper.co.uk/ > Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ > > CFDeveloper Sponsors and contributors:- > *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided > by activepdf.com* > *Forums provided by fusetalk.com* :: *ProWorkFlow provided by > proworkflow.com* > *Tutorials provided by helmguru.com* :: *Lists hosted by > gradwell.com* > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > -- > These lists are syncronised with the CFDeveloper forum at > http://forum.cfdeveloper.co.uk/ > Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ > > CFDeveloper Sponsors and contributors:- > *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided > by activepdf.com* > *Forums provided by fusetalk.com* :: *ProWorkFlow provided by > proworkflow.com* > *Tutorials provided by helmguru.com* :: *Lists hosted by > gradwell.com* > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > > > > -- > These lists are syncronised with the CFDeveloper forum at > http://forum.cfdeveloper.co.uk/ > Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ > > CFDeveloper Sponsors and contributors:- > *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided > by activepdf.com* > *Forums provided by fusetalk.com* :: *ProWorkFlow provided by > proworkflow.com* > *Tutorials provided by helmguru.com* :: *Lists hosted by > gradwell.com* > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > -- > These lists are syncronised with the CFDeveloper forum at http://forum.cfdeveloper.co.uk/ > Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ > > CFDeveloper Sponsors and contributors:- > *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by activepdf.com* > *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com* > *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com* > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > -- These lists are syncronised with the CFDeveloper forum at http://forum.cfdeveloper.co.uk/ Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ CFDeveloper Sponsors and contributors:- *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by activepdf.com* *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com* *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com* To unsubscribe, e-mail: [EMAIL PROTECTED]