Guillermo
Posts: 14
|
Posted: 11/01/2005, 11:47 AM |
|
Hello,
I need to change to upper case the value entered on an textbox on a search form I have. I have tested few codes, but none of them worked. I tried the followings on the "On Validate" event.
Dim s_IWKEY_Cap As String = s_IWKEY.Value
s_IWKEY.Value = s_IWKEY_Cap.ToUpper
s_IWKEY.Value = UCase(s_IWKEY.Value)
s_IWKEY.Value = s_IWKEY.Value.ToUpper
But none of them work....
Any ideas?
Thanks
|
|
|
Edd
Posts: 547
|
Posted: 11/01/2005, 1:50 PM |
|
Guillermo,
Use Javascript - add something like this to the contol.
onChange="this.value=this.value.toUpperCase();"
Edd
_________________
Accepting and instigating change are life's challenges.
http://www.syntech.com.au |
|
|
Guillermo
Posts: 14
|
Posted: 11/02/2005, 11:19 AM |
|
I tried that, but the code does not show up in the generated page. I change this in the HTML tab:
<input class="NoiseInput" maxlength="30" size="30" value="{s_IWKEY}" name="{s_IWKEY_Name}" onChange="this.value=this.value.toUpperCase();">
Then on generated ASPX page is changed to:
<asp:TextBox id="VIOITEWBBSearchs_IWKEY" CssClass="NoiseInput" maxlength="30" Columns="30" runat="server"/>
And on the final HTML (.aspx on the web server displayed page) this is what is shown:
<input name="VIOITEWBBSearchs_IWKEY" type="text" maxlength="30" size="30" id="VIOITEWBBSearchs_IWKEY" class="NoiseInput" />
|
|
|
Edd
Posts: 547
|
Posted: 11/03/2005, 1:32 PM |
|
Did you put it in the CCS designer onChange event or in the HTML.
Edd
_________________
Accepting and instigating change are life's challenges.
http://www.syntech.com.au |
|
|
E43509
Posts: 283
|
Posted: 11/07/2005, 9:49 AM |
|
In .net I don't think you can just add events to the html file, at least I couldn't. You need to do it programmatically
mycontrol.attributes("onchange") = "this.value=this.value.toUpperCase"
But I've also found that if they just hit enter after putting in their data, the uppercase gets lost. I've resorted to chaning my sql for the grid to do a upper(x) before returning the data. You have to use expression.
|
|
|