Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP Text Box Default Value

Status
Not open for further replies.

RottPaws

Programmer
Mar 1, 2002
478
US
I've got an ASP form that collects input from the user and then passes it to another page that uses it as criteria for a query that looks up and displays information.

Everything is working, but now I'd like to add a default value to a couple of the text boxes.

For example, a customer may have hundreds of locations, but the master account information is stored in location 0 for a given customer account number.

I've got a text box that accepts an account number and another that accepts a location number. I'd like to set the default location number to 0.

Here's what I have for the text box HTML:
<INPUT id=Loc_No style=&quot;WIDTH: 75px; HEIGHT: 22px&quot; maxLength=5 size=10 name=Loc_No value=&quot;<%=Loc_No%>&quot; >

How do I set a default value? _________
Rott Paws
 
Why do you have the Value=&quot;<%=Loc_no%>&quot;? Just wondering because if you are getting that value for some reason because as it stands now, that is your default value. If you want it to be 0 just use Value=&quot;0&quot;


<INPUT id=Loc_No style=&quot;WIDTH: 75px; HEIGHT: 22px&quot; maxLength=5 size=10 name=Loc_No value=&quot;<%=Loc_No%>&quot; >
 
That was too easy. Thanks1!

I'm trying to migrate an app I created in VB to the web and know just enough to probably be dangerous. I basically took an existing form from another web app and modified it do my bidding . . . .

I thought that &quot;<%=Loc_No%>&quot; was assigned the entered value to a variable that was then passed to the routine that actually looks up and displays the info. Didn't realize that that was trying to look up an existing value from a db or something . . . .

I guess this is my dumb beginner's quetstion for the day . . . [surprise] _________
Rott Paws
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top