ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
javascript: change value of text field and submit without trace?
I am porting my *nix POS restaurant from command line version to web version (once it become stable, I would clear up the code and release it as GPL or MPL soon).
In order to change the work area to desk 7. The command line version would have to type 07[enter], the web version would accept both 07[enter] or 7[desk]. The desk key is in fact the numlock mapped as a comma (keyCode==188). You can see it as 7[comma]. The javascript would take care of the value transformation.
The problem is that when the value of the text field change from "7" to "07", it would appear as "07," or "07" for a very short time.
- I would like only "7" appear in the field while submitting, it is also ok if the value is not visible temporary
- if change the type from "text" to "hidden", it would just disappear and the layout changed
How can I change the value without trace while submitting?
Note: this program use firefox as front end, cache, history, form, saved password all disabled.
Do you mean that you want to display it as 07 but only send 7 to the server? I'd recommend performing this check/change on the server side and not on the client side, it leaves a lot less places for things to go wrong.
In a restaurant system. the waiter usually have to input the desk ID and then input the dishes and/or services. They made mistake sometimes mistaking the messing with the desk ID or Plate ID.
In order to solve the problem:
1) desk id is begin with 0 in the command line version. so in order to change the work area to desk 5, they must enter 05.
2) make a custom "desk" key. People enter 5[desk] without enter would do the same job. javascript is required.
If the javascript just transform the same command to type 1. No modification is need in the server side command interpretator. In fact I have 5-7 more keys using the same trick.
Anyway, thanks. If I can't find better way, I may modify the server side code doubleing the code.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.