Page 1 of 1

Retreiving disabled form field information

Posted: Fri Jan 13, 2006 11:39 am
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?

Posted: Fri Jan 13, 2006 3:23 pm
by feyd
do the calculation on the server?

Posted: Fri Jan 13, 2006 4:01 pm
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...

Posted: Fri Jan 13, 2006 4:07 pm
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.

Posted: Fri Jan 13, 2006 7:24 pm
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()" />

Posted: Fri Jan 13, 2006 9:04 pm
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.

Posted: Sat Jan 14, 2006 4:55 am
by Chris Corbyn

Code: Select all

<input type="text" name="foo" readonly="readonly" />

Posted: Sat Jan 14, 2006 6:16 am
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.

Re: Retreiving disabled form field information

Posted: Sat Jan 14, 2006 5:26 pm
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...

Re: Retreiving disabled form field information

Posted: Sat Jan 14, 2006 5:38 pm
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.