[TriLUG] tax forms and JavaScript

Tim Jowers via TriLUG trilug at trilug.org
Fri Jun 10 12:23:36 EDT 2016


I don't know about the PDF, but, yes, js can easily do that and, yes, js
does not per se have strong numerical support.
So, a typical implementation would be to auto-add the .00 on any number
input. I feel this is analogous to tax forms where the .00 is already on
the form. As a side note, some Android devices do not support a period on
the keypad if an html5 number type input is used. Well, in your case that
would be the correct input type.

1. I think their interpretation is more correct as tax forms have the .00
on them.
2. No. After entry the js would clean the data. And/or during the input
after each key.
3. Extra code. js is basically strings. It can do some math but only basic
math is reliable.

I'd auto-add the .00. So, if the customer types 2 then it would be 2.00 and
23 then it would show 23.00. Sorta yucky, but works. Another idea is to
have a non-editable label of ".00" to the right. But you'd have to do some
user test on this. The disallow any . period to be put into the left input.
That is almost exactly like the tax forms.

Cheers,
Tim



On Fri, Jun 10, 2016 at 11:42 AM, Peter Neilson via TriLUG <
trilug at trilug.org> wrote:

> Just tried testing this pdf form:
> http://www.dor.state.nc.us/downloads/fillin/D400_webfill.pdf
> and found that its behavior is crazier than you suggest.
>
> At one point I entered 500 and it auto-filled it to 500.0000 which is
> truly weird.
>
> The requirement for being allowed to do programming for NC DOR appears to
> be something other than the ability to code correctly. Similarly, their
> software QC appears to be lacking.
>
>
> On Fri, 10 Jun 2016 11:27:51 -0400, mr-trilug via TriLUG <
> trilug at trilug.org> wrote:
>
> This is a query about JavaScript programming.
>>
>> The NC-DOR D-400 web-fill form instructions assert: "Enter Whole U.S.
>> Dollars Only."
>>      To me this means: do not enter a decimal and two digits, including
>> ".00."
>>      To DOR it appears to mean "xxxxxx.00".
>>
>> Questions:
>>
>>  1. Is my interpretation, "xxxxxxx" reasonable?
>>  2. Would JavaScript have any difficulty in being programmed to read
>>     both xxxxxxx. AND xxxxxxx.cc, including xxxxxx.00.
>>  3. If the answer to [2] is NO DIFFICULTY, would JavaScript just do the
>>     proper calculations by default or would it need some extra code to
>>     cope with numbers in different formats?
>>
>> Thanks for comments.
>>
>> M. Rul
>>
> --
> This message was sent to: timjowers <timjowers at gmail.com>
> To unsubscribe, send a blank message to trilug-leave at trilug.org from that
> address.
> TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug
> Unsubscribe or edit options on the web  :
> http://www.trilug.org/mailman/options/trilug/timjowers%40gmail.com
> Welcome to TriLUG: http://trilug.org/welcome
>


More information about the TriLUG mailing list