Forum Moderators: open

Message Too Old, No Replies

Form textboxes...

         

trav001

9:57 pm on Dec 17, 2001 (gmt 0)



I know this is a little wacky..but I'm working for a company who wants an online store...now there weird part is when the customer checks out with the shopping cart..there is a textbox field that contains the item price. Now if the item price is in our database, the user (is not supposed)to be allowed to enter numbers into that field. If the item is listed at $0.00 the user is then allowed to type the price in. Is it possible to set a condition like this up? I know its wacky but this is what i've been asked to do. 1. Can this condition be set? 2. How do you make a textbox not active for type in on case and active in another? Thanks!

txbakers

10:18 pm on Dec 17, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It's not wacky, it's very popular. I would do this using an ASP. The web page would read the database and populate the text box with the price if there is one. If there isn't a price, show 0.

Then, you could put a simple validation script to catch the onChange method of the box. If the value of the box <> 0 alert("Don't change the price, eh?")

I'm sure there are lots of ways to handle it. But I like active server pages.

Brett_Tabke

10:20 pm on Dec 17, 2001 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Hi trav, welcome to the board. I'd start with the premise, not in our database. Why wouldn't it be in your database?

The other part is that you'd need a cgi to do it right. When the form page is generated, there should be a if-then statement to see if there is the price. If it isn't, they get one version of the checkout page, and if there is, they get the other one.