[Pro] Up/down increment arrows with form field boxes

Hello,

Can someone help me get rid of the increment up/down arrows that appear on the right of form fields boxes? I see them appear with different types of fields (number, date, time) in preview mode (both FW and the browser). When I select ‘None’ from the Step drop down menu, it doesn’t seem to show up as selected (whereas the other options do) so I am not sure if this is where the problem is.

If so, any idea why I can’t seem to select ‘None’?

If not, how do I get rid of the arrows?

Thanks

Sid


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

These are drawn by some browsers when they are handed an <input type="number"> field. You didn’t add them, the browser did. If you set your field to a different field type – maybe the generic text input, I guarantee you won’t see them, just as before.

Walter

On Nov 18, 2013, at 6:56 AM, Siddhartha Ghose wrote:

Hello,

Can someone help me get rid of the increment up/down arrows that appear on the right of form fields boxes? I see them appear with different types of fields (number, date, time) in preview mode (both FW and the browser). When I select ‘None’ from the Step drop down menu, it doesn’t seem to show up as selected (whereas the other options do) so I am not sure if this is where the problem is.

If so, any idea why I can’t seem to select ‘None’?

If not, how do I get rid of the arrows?

Thanks

Sid


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks Walter, always learning something new! I noticed that Safari adds the arrows, Firefox doesn’t.

If I set the field to a generic text input, will that not compromise the ability to work with the data in the back end database? So if need to do statistical and other maths calculations on the inputted data, will I not need to have them as number inputs in the form fields?

Sid


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

No. Dirty secret here: all form fields submit as text, regardless of how they appear on screen in a browser. A form submission is a hash of keys and values, with the keys always being strings based on the name attribute of the form element, and the values always being strings (or arrays of strings) based on the value attribute of the form element. If you change the Action attribute of your form to this: Reflector you can see the exact layout of your form as the server “sees” it. Remember that anything that appears inside of quotes (in this tool) is a string. You’ll see lots of quotes.

Walter

On Nov 18, 2013, at 8:33 AM, Siddhartha Ghose wrote:

Thanks Walter, always learning something new! I noticed that Safari adds the arrows, Firefox doesn’t.

If I set the field to a generic text input, will that not compromise the ability to work with the data in the back end database? So if need to do statistical and other maths calculations on the inputted data, will I not need to have them as number inputs in the form fields?

Sid


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Aha, forgot to answer this. Carve this saying into stone, put it next to your computer:

##Never trust user input any further than you can spit a live rat.

Always sanitize and normalize user input. Always. If you are using PHP, there are some helpful type-casting tools in the core language which can help with this.

$input = 'foo';
$input = (int) $input;
// $input is now the integer 0

If your program cannot accept values outside of a particular range, you might be tempted to put this value’s options into a picking list (select tag). Remember that you do not control the page that sends you that data. One of the simplest hacking tricks of all is to “scrape” your form fields and construct a new form to submit to your server that is not bound by these restrictions. If your program cannot deal with an input above 100, then force the top bound of that input thus:

$input = '2500';
$input = (int) $input;
$input = ($input > 100) ? 100 : $input;
// $input is now 100

Oh, and when you’re programming any sort of a commerce application, never let the user send you the prices, only an SKU and quantity. Always look up the unit price and calculate the total price on the server, even if you offer a “convenience” feature in JavaScript on the cart page. It’s nice to your users to not force them to take a round-trip to the server just to find out that three widgets cost $33 if one costs $11. But let the user send you the total price, and you’ll find yourself in Brokeville, population you.

Walter

On Nov 18, 2013, at 8:33 AM, Siddhartha Ghose wrote:

So if need to do statistical and other maths calculations on the inputted data, will I not need to have them as number inputs in the form fields?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks for all this rich information, Walter. I am not a great expert in the coding so will be turning to others, including this forum, for help on details. I am some way off before the PHP bit (which someone else is going to be doing at some point) but I have a feeling that I’ll be asking many more questions about various bits and pieces.

Btw, I didn’t quite get what you meant in your last but one message:

“If you change the Action attribute of your form to this: Reflector you can see the exact layout of your form as the server “sees” it.”

There was no visible form and nothing below the “Back” link which also didn’t seem to take me anywhere.

Sid


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

In Freeway, in the Page / Form Setup dialog, change whatever you have currently entered to the URL I posted. Then submit your form. This will show you precisely what the form has sent, nothing more or less. All it does is print the input to the screen.

Walter

On Nov 18, 2013, at 11:18 AM, Siddhartha Ghose wrote:

Thanks for all this rich information, Walter. I am not a great expert in the coding so will be turning to others, including this forum, for help on details. I am some way off before the PHP bit (which someone else is going to be doing at some point) but I have a feeling that I’ll be asking many more questions about various bits and pieces.

Btw, I didn’t quite get what you meant in your last but one message:

“If you change the Action attribute of your form to this: Reflector you can see the exact layout of your form as the server “sees” it.”

There was no visible form and nothing below the “Back” link which also didn’t seem to take me anywhere.

Sid


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options