473,466 Members | 1,395 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

limiting input form.

155 New Member
i got some small or big problem ,for now it's big :)

i got input form for price ,the price should go like this:

example 23.23.

i got auction site ,it works like that : if you input a bid price that some one else already bid then your bid is getting burnt ,example:

if i bid for 66.98 and you bid for 66.98 we both got burnt ,and if some one else is going to bid for 66.98 ,he will get burn too!

now my serius problem is:

if i bid for 66.98 and you will bid for 66.981 we are both well ,but in the database we both will have the same bid!!


how do i limit the input price after the dot?

there is maybe way in javascript maybe to check that there is only two numbers after the dot?

please help me with that!! ,im stuck!!


i did limit in the input form for maxlength and max size ,but it's not the way for me.
Aug 14 '09 #1
6 1775
Dheeraj Joshi
1,123 Recognized Expert Top Contributor
You can have something like decimal(5,2) in the database. IT basically allows you to enter 5 integer units and 2 decimal units.

Allowed 234.56
12345.67
Not allowed : 34.5667
123434545.78

So you need to validate it in server side.

One more way is to go for client side validation through java script.

Have a regular expression for any number with 2 decimal units.

So if user enters more units after decimal you can give a error message and make him force to enter only two units.

Hope this was the answer you were looking for. Hope it helps

Regards
Dheeraj Joshi
Aug 15 '09 #2
canabatz
155 New Member
this is the answer!! :)
Aug 15 '09 #3
Dheeraj Joshi
1,123 Recognized Expert Top Contributor
It helped you?

Regards
Dheeraj Joshi
Aug 15 '09 #4
canabatz
155 New Member
i need to come out with the solution with javascript!

i most stop the user before it comes to the database!

i got to give alert to the user before submit to the database ,im searching the net
now for regular expression like you told me!! :)


i need it to be like that before you can submit : example 23.23!! not like that 23.231

i let you know when i succeed .

thanx man!!
Aug 15 '09 #5
Dheeraj Joshi
1,123 Recognized Expert Top Contributor
This link may help you to get some Regex's

Link

Regards
Dheeraj Joshi
Aug 15 '09 #6
zorgi
431 Recognized Expert Contributor
maybe this

http://www.webresourcesdepot.com/jav...t-input-masks/
Aug 15 '09 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Otto Krüse | last post by:
Hi everyone, I'm building a GUI in which I want, amongst other things, for people to fill in there postal code. The postal codes of my country (Holland) are in this format: 1234 AB So for the...
6
by: Kingdom | last post by:
I'm using this script to dynamicaly populate 2 dropdowns and dispaly the results. Choose a component type from the first drop down, lets say 'car' and the second box will list all the car...
7
by: Adam Smith | last post by:
Hello, Designing a form, with field layout in a table to maintain consistency in appearance. Table field heights set to 13 pxs. Textfield default height is 24 pxs. how can I reduce it so as to...
10
by: Rogue Chameleon | last post by:
Hi all I have a input filed of type "textbox" into which I am expecting to get currency values (ie. 199.99). Is there a way that I can restrict the user to only entering 2 values after the...
18
by: OrenFlekser | last post by:
Hi I've posted this message couple of days ago, but I can't find it now, so sorry if you see it twice... Anyways - I have a text box, and I want my users to be able to write only in english...
6
by: Gerry Abbott | last post by:
Hi all, Have written some code to limit the concurrent users of a database. Use the Autoexec macro to open a form. When the form opens it increments a value in a table. When the form closes...
3
by: B | last post by:
I know there are several ways to speed up combo boxes and form loading. Most of the solutions leave rowsource of the combo box blank and set the rowsource to a saved query or an SQL with a where...
2
by: Kathy | last post by:
Scenario: Multiple Divisions. Each Division has multiple Buildings. Each Building has multiple Floors. Each Floor has a Supervisor. Tables: (abbreviated) TblDivision DivisionID Division
4
WyvsEyeView
by: WyvsEyeView | last post by:
I have a datasheet form in which one field is a combo box that will potentially contain hundreds of records. I've read about several methods of speeding up such combo boxes or limiting their initial...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.