problem with input from textbox

easyeman
01-18-2007, 09:18 AM
I need some help...I have a page that allows a customer to type in a customer number and Purchase Order number, and I have it set to Autopostback for the CustNum so that when a customer types their 6 digit Customer Number in, it will pull up their billing information on that page and then they can click the next button to continue checking out with selecting shipping address, etc like a Web site normally has.

The problem I found is that it is case-sensitive so if a customer types in say "dec050" then it will pull up the Billing Information as "NONE" even though that is a good number. But when you type in "DEC050" with caps it will display it correctly.

However, the annoying thing that is happening is that I have set a CSS tag to cause the text to automatically capitalize (text-transform: uppercase) which seems easy enough. But for some odd reason that doesn't work, and while it makes the text all caps when typing in the textbox, it still doesn't pull up the billing information! Basically I can type in "dec050" with no caps and it will display "DEC050" but it won't pull it...HOWEVER when I actually have caps-lock on or hold shift to enter "DEC050" it works! It's killing me

This is just getting annoying for me, so does anyone have any suggestions as to how to fix this. I'm just trying to get the billing information to pull up in the area at the bottom when a customer enters a good Customer Number, and I want it set so that the customer can just type it in and it not be case-sensitive. Is there a way to fix it on input or is there some code I need to put in so it does it in the VB code? It seems simple but I'm lost and need help. I appreciate it!

easyeman
01-18-2007, 01:28 PM
I should have added that I do know about the ToUpper method of the System.String class and actually tried that first. I know using css styling to display the text in uppercase will only affect the way the text is being displayed and not the actual text value. However I did try the ToUpper method but it still did not work.

So I guess I'm just wondering what I need to do to get it to read correctly...is there a certain place I need to put the method? Do I need to combine it at all with the display of the text? I've tried several things but can't seem to get it to work which is why I'm asking. It's probably something very simple but I'm just overlooking it.

Oh and here's the code I have in the VB file just so you can see what I have and where I'd need to put the ToUpper if it will work. Thanks!

Dim strNevisID As String

strNevisID = txtCustNum.Text.Trim '(txtCustNum is of course the name of the textbox I have where customers insert the Customer number)

If strNevisID.Length > 5 Then
'Gets the current Billing Address from ISeries Database
Dim Info As site.WebStore.MyAccountDB = New site.WebStore.MyAccountDB
Dim BA As site.WebStore.BillingInfo = New site.WebStore.BillingInfo

BA = Info.GetBillingAddress(strNevisID)
BName.Text = BA.Name
BA1.Text = BA.Address1
If Trim(BA.Address2).Length > 2 Then
BA2.Visible = True
BA2.Text = BA.Address2
End If
If Trim(BA.Address3).Length > 2 Then
BA3.Visible = True
BA3.Text = BA.Address3
End If
BCity.Text = BA.City
BState.Text = BA.State
BZip.Text = BA.Zip
End If

Eduardo Lorenzo
01-18-2007, 04:59 PM
strNevisID = txtCustNum.Text.ToUpper.Trim

easyeman
01-19-2007, 08:12 AM
strNevisID = txtCustNum.Text.ToUpper.Trim

argh thanks! haha...I figured it was something stupid and simple but I was just overlooking it. Most people suggested just ToUpper but not to trim it and do it with what I had already. But I should have figured that out too. I should put it all together instead of making two separate statements. I'll try that out to see how it works but I appreciate the help!

Sometimes it is the most simple things that hang me up because I think too complicated and think it's some big thing but all I gotta do is edit one small thing :) thanks again

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum