Retreiving disabled form field information

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Retreiving disabled form field information

Post by Luke »

I am creating an orderform where you enter the subtotal and the form calculates your tax, and figures shipping, etc. After if figures theses, it puts that information in individual text boxes and disables them so the user can't mess them up. The problem is that when the fields are disabled, their information does not get posted... how do I fix this?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

do the calculation on the server?
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post by raghavan20 »

You are disabling the text fields then why do you want to submit again....it would be good if you can put the link to the live file...
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

1. disabled fields are not sent to the server. on the other hand, readonly fields are sent
2. do not trust the user's browser, alway do the math on server.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

Ya know, no offense to y'all, because most of the time you're helpful, but a lot of folks around here seem to think that you are helping by telling people that the way they are doing something is wrong.

Don't get me wrong, I appreciate this place a lot, but I can't even count how many times I've asked a question and gotten three answers saying "Well there is no need to answer that question because you're not supposed to do it like that anyway"

For my particular purpose, this is the IDEAL solution... I do not need people to tell my why I am doing it wrong, I just need to know the answer to my question.

I figured it out by myself anyway... thanks though..

Code: Select all

<input type="text" name="total" onfocus="this.blur()" />
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Don't bark at us for not understanding why, when you don't explain it.. :?

Anyways, you could use hidden fields, which is a tiny tiny tiny bit safer.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Code: Select all

<input type="text" name="foo" readonly="readonly" />
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post by raghavan20 »

It is common for people not to explain the problem but you cannot expect the people giving reply to read what you are thinking in your mind. Whoever replies here, if they say something like, "why you doing this or why you following this method", that is a clue for you to know that you are doing something different from the normal, standard and time-tested way of doing it.

If you are not satisfied with the answers, it is your responsibility to explain the problem to your best so that we understand why you are following a certain method and this puts us in your place and we could think of some good method to counter the problem.

So, from your next post, do not expect the best reply if you fail to explain the problem and the context of the problem. This is not just for you and this is for anyone who expects the same.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Re: Retreiving disabled form field information

Post by Luke »

The Ninja Space Goat wrote: The problem is that when the fields are disabled, their information does not get posted... how do I fix this?
Simply Stated...
foobar
Forum Regular
Posts: 613
Joined: Wed Sep 28, 2005 10:08 am

Re: Retreiving disabled form field information

Post by foobar »

The Ninja Space Goat wrote:
The Ninja Space Goat wrote: The problem is that when the fields are disabled, their information does not get posted... how do I fix this?
Simply Stated...
Wierdan wrote:1. disabled fields are not sent to the server. on the other hand, readonly fields are sent
2. do not trust the user's browser, alway do the math on server.
Simply answered.
Post Reply