![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Display Text in Upper Case Sorry guys my Javascript is very limited! I must have the educator enter some data as upper case. I have fought with this for four days now and realize I need some help. First question; Is there any way I can do this without using Javascript? Here is my current scripting code. function changeToUpperCase(onKeyUp) { document.getElementById(onChange).value.toUpperCase(); } <Input Type="Text" Name="txtBlChip" Id="txtBlChip" Size="1" MaxLength="1" Value="S" onKeyUp="changeToUpperCase(this.txtBlChip)" onChange="changeToUpperCase(this.txtBlChip)"> What am I doing wrong? Thanks in advance Toni |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Display Text in Upper Case "Antonette" <Antonette@xxxxxx> wrote in message news:E657E382-885B-4868-8D0A-71099F89D624@xxxxxx Quote: > Sorry guys my Javascript is very limited! > > I must have the educator enter some data as upper case. I have fought > with > this for four days now and realize I need some help. > > First question; Is there any way I can do this without using Javascript? > > Here is my current scripting code. > > function changeToUpperCase(onKeyUp) > { > document.getElementById(onChange).value.toUpperCase(); > } > > <Input Type="Text" Name="txtBlChip" Id="txtBlChip" Size="1" MaxLength="1" > Value="S" onKeyUp="changeToUpperCase(this.txtBlChip)" > onChange="changeToUpperCase(this.txtBlChip)"> > > What am I doing wrong? > > Thanks in advance > > Toni |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Display Text in Upper Case I want to reiterate - can this be done without using JScript or Java? Thank You. "Pegasus [MVP]" wrote: Quote: > > "Antonette" <Antonette@xxxxxx> wrote in message > news:E657E382-885B-4868-8D0A-71099F89D624@xxxxxx Quote: > > Sorry guys my Javascript is very limited! > > > > I must have the educator enter some data as upper case. I have fought > > with > > this for four days now and realize I need some help. > > > > First question; Is there any way I can do this without using Javascript? > > > > Here is my current scripting code. > > > > function changeToUpperCase(onKeyUp) > > { > > document.getElementById(onChange).value.toUpperCase(); > > } > > > > <Input Type="Text" Name="txtBlChip" Id="txtBlChip" Size="1" MaxLength="1" > > Value="S" onKeyUp="changeToUpperCase(this.txtBlChip)" > > onChange="changeToUpperCase(this.txtBlChip)"> > > > > What am I doing wrong? > > > > Thanks in advance > > > > Toni > I would repost in a Java newsgroup. > > > |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Display Text in Upper Case You could do it in your server-side code if you are using ASP. You could also use a trigger on your database if you are storing this text in a database that supports triggers. Or, you could let the user enter the data any way he wants, but convert to upper case whenever displaying it. This could be done in the sql statement that retrieves the text from the database (if you are using a database) or in your server-side code if you are using ASP. Antonette wrote: Quote: > I want to reiterate - can this be done without using JScript or Java? > > Thank You. > > "Pegasus [MVP]" wrote: > Quote: >> >> "Antonette" <Antonette@xxxxxx> wrote in message >> news:E657E382-885B-4868-8D0A-71099F89D624@xxxxxx Quote: >>> Sorry guys my Javascript is very limited! >>> >>> I must have the educator enter some data as upper case. I have >>> fought with >>> this for four days now and realize I need some help. >>> >>> First question; Is there any way I can do this without using >>> Javascript? >>> >>> Here is my current scripting code. >>> >>> function changeToUpperCase(onKeyUp) >>> { >>> document.getElementById(onChange).value.toUpperCase(); >>> } >>> >>> <Input Type="Text" Name="txtBlChip" Id="txtBlChip" Size="1" >>> MaxLength="1" Value="S" onKeyUp="changeToUpperCase(this.txtBlChip)" >>> onChange="changeToUpperCase(this.txtBlChip)"> >>> >>> What am I doing wrong? >>> >>> Thanks in advance >>> >>> Toni >> I would repost in a Java newsgroup. Microsoft MVP - ASP/ASP.NET - 2004-2007 Please reply to the newsgroup. This email account is my spam trap so I don't check it very often. If you must reply off-line, then remove the "NO SPAM" |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Display Text in Upper Case =?Utf-8?B?QW50b25ldHRl?= wrote on 31 mei 2009 in microsoft.public.scripting.vbscript: Quote: > Sorry guys my Javascript is very limited! > > I must have the educator enter some data as upper case. I have fought > with this for four days now and realize I need some help. > > First question; Is there any way I can do this without using > Javascript? > > Here is my current scripting code. > > function changeToUpperCase(onKeyUp) > { > document.getElementById(onChange).value.toUpperCase(); onchange is not a pointer!!! You will have to do something with the resulting string like sending it back to the screen. Quote: > } > > <Input Type="Text" Name="txtBlChip" Id="txtBlChip" Size="1" > MaxLength="1" > Value="S" onKeyUp="changeToUpperCase(this.txtBlChip)" > onChange="changeToUpperCase(this.txtBlChip)"> txtBlChip is not a attribute of this. Id is. But you have the pointer to the <input> already in "this". Do not include things that have nothing to do with your Q. Use onblur. with onchange and onkeyup the textcursor will be set to the end-of-string position at each key entry. Quote: > What am I doing wrong? Try: ========================================== <input type="text" name="txtX" id="txtX" value="testvalue" onBlur="changeToUpperCase(this)" Quote: > x.value = x.value.toUpperCase(); }; ========================================== -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress) |
My System Specs![]() |
| | #6 (permalink) |
| | Re: Display Text in Upper Case Evertjan. wrote on 31 mei 2009 in microsoft.public.scripting.vbscript: Quote: > =?Utf-8?B?QW50b25ldHRl?= wrote on 31 mei 2009 in > microsoft.public.scripting.vbscript: > Quote: >> Sorry guys my Javascript is very limited! >> >> I must have the educator enter some data as upper case. I have fought >> with this for four days now and realize I need some help. >> >> First question; Is there any way I can do this without using >> Javascript? >> >> Here is my current scripting code. >> >> function changeToUpperCase(onKeyUp) >> { >> document.getElementById(onChange).value.toUpperCase(); > ==getElementById(onChange)== > > onchange is not a pointer!!! > > You will have to do something with the resulting string like sending it > back to the screen. > Quote: >> } >> >> <Input Type="Text" Name="txtBlChip" Id="txtBlChip" Size="1" >> MaxLength="1" >> Value="S" onKeyUp="changeToUpperCase(this.txtBlChip)" >> onChange="changeToUpperCase(this.txtBlChip)"> > ========this.txtBlChip====== > > txtBlChip is not a attribute of this. > Id is. > But you have the pointer to the <input> already in "this". > > Do not include things that have nothing to do with your Q. > > Use onblur. with onchange and onkeyup the textcursor will be set to the > end-of-string position at each key entry. > Quote: >> What am I doing wrong? > Lots of things. See above. > > > Try: > ========================================== > <input > type="text" name="txtX" id="txtX" value="testvalue" > onBlur="changeToUpperCase(this)" Quote: >> > function changeToUpperCase(x) { > x.value = x.value.toUpperCase(); >}; > ========================================== VBscript will only be usable in IE. -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress) |
My System Specs![]() |
| | #7 (permalink) |
| | Re: Display Text in Upper Case "Antonette" <Antonette@xxxxxx> wrote in message news:8097C1F6-F53A-455E-823A-475E809A3807@xxxxxx Quote: >I want to reiterate - can this be done without using JScript or Java? > sInput = "d:\temp\dir.txt" sOutput = "d:\temp\dir.out" Set oFSO = CreateObject("Scripting.FileSystemObject") Set oInput = oFSO.OpenTextFile(sInput) Set oOutput = oFSO.CreateTextFile(sOutput,vbTrue) sData = UCase(oInput.ReadAll) oOutput.Write sData oInput.Close oOutput.Close If it's user input rather than file input you wish to translate then you could use the VB Script function "InputBox". However, moving between Java and VB Script does not look like an elegant solution to me - asking the Java experts how to do all of it in Java would give you a much cleaner method. |
My System Specs![]() |
| | #8 (permalink) |
| | Re: Display Text in Upper Case Thank You very much, I am going to school this afternoon and I will try it. Hope you have a great day. "Evertjan." wrote: Quote: > Evertjan. wrote on 31 mei 2009 in microsoft.public.scripting.vbscript: > Quote: > > =?Utf-8?B?QW50b25ldHRl?= wrote on 31 mei 2009 in > > microsoft.public.scripting.vbscript: > > Quote: > >> Sorry guys my Javascript is very limited! > >> > >> I must have the educator enter some data as upper case. I have fought > >> with this for four days now and realize I need some help. > >> > >> First question; Is there any way I can do this without using > >> Javascript? > >> > >> Here is my current scripting code. > >> > >> function changeToUpperCase(onKeyUp) > >> { > >> document.getElementById(onChange).value.toUpperCase(); > > ==getElementById(onChange)== > > > > onchange is not a pointer!!! > > > > You will have to do something with the resulting string like sending it > > back to the screen. > > Quote: > >> } > >> > >> <Input Type="Text" Name="txtBlChip" Id="txtBlChip" Size="1" > >> MaxLength="1" > >> Value="S" onKeyUp="changeToUpperCase(this.txtBlChip)" > >> onChange="changeToUpperCase(this.txtBlChip)"> > > ========this.txtBlChip====== > > > > txtBlChip is not a attribute of this. > > Id is. > > But you have the pointer to the <input> already in "this". > > > > Do not include things that have nothing to do with your Q. > > > > Use onblur. with onchange and onkeyup the textcursor will be set to the > > end-of-string position at each key entry. > > Quote: > >> What am I doing wrong? > > Lots of things. See above. > > > > > > Try: > > ========================================== > > <input > > type="text" name="txtX" id="txtX" value="testvalue" > > onBlur="changeToUpperCase(this)" Quote: > >> > > function changeToUpperCase(x) { > > x.value = x.value.toUpperCase(); > >}; > > ========================================== > Oh, I see you are in the wrong NG for Javascript. > > VBscript will only be usable in IE. > > > -- > Evertjan. > The Netherlands. > (Please change the x'es to dots in my emailaddress) > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Display does not align text properly | Vista General | |||
| Text display problem HELP PLEASE | Vista General | |||
| Windows Update Won't Display Text | Vista security | |||
| upper case I | Vista performance & maintenance | |||
| Utility To Display CPU/Case/Motherboard Temps? | Vista General | |||