Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
padseeker
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
31.
▲
by
padseeker
4y ago
As someone who built a product that is a form builder that uses React, https://keenforms.com , the best thing I can say is this; Most of these libraries are fine for simple to medium complexity forms. However once you cross a cer
32.
▲
by
padseeker
4y ago
If they enter 'quux' or any invalid number then it should mark it as invalid, but if its blank then treat it as zero. You are correct the validity.valid or checkValidity() could be used in the right way to make the distinction bet
33.
▲
by
padseeker
4y ago
Not returning the invalid value is in fact the fault of the platform. On more than one occasion I've been asked to put the invalid value in the error message. If you are using a framework like React or Angular, which I do a lot, then y
34.
▲
by
padseeker
4y ago
The edge case I cited and your solution works. This method will help make the distinction between a non required number input containing an invalid value versus blank. I learned something today. Thank you for this. I'm going to read mo
35.
▲
by
padseeker
4y ago
Just because you didn't run into these problems doesn't mean they don't exist. The clients I do work for have very complicated requirements and expect a lot of dynamic interactions from the forms they pay for. It could be a n
36.
▲
by
padseeker
4y ago
thank you so much for this
37.
▲
by
padseeker
4y ago
I'll admit I name dropped my own product a lot. As a programmer I'm a little embarrassed, bordering on shameless. But as a single founder it means I have to do marketing, which means I have to be a little shameless.
38.
▲
by
padseeker
4y ago
I can't make this any clearer to you - if you have an invalid value like "ABC" you don't want to treat it like a zero, you want to treat it like an invalid value and not perform the calculation until the user corrects th
39.
▲
by
padseeker
4y ago
Thank you so much for asking so kindly. I'd actually be thrilled to do that. I built a form that gave a price estimate for a product, and it would change as you modified inputs on the screen. One of the requests was to treat a blank nu
40.
▲
by
padseeker
4y ago
And while we are on the subject it should be noted that number params submitted with exponential notation, i.e. 2.47e3 will not always be converted to a number. The app I built uses Ruby on Rails. While Ruby is smart enough to convert the s
41.
▲
by
padseeker
4y ago
There have been requests for functionality to use an inputs value for a calculation, like for a price estimate. The requirements were also for a blank input to be treated as a zero. Because of the invalid value returned as blank there is no
42.
▲
by
padseeker
4y ago
I actually mentioned that at the bottom of the article on how to handle the issues mentioned. Firmly agreed, using the number input for non mathematical values is a horrible idea.
43.
▲
by
padseeker
4y ago
It depends on what you are using on the back end. So for the record my own app's back end is Ruby on Rails. If you enter the value "3.9e3" which represents the number 3900, Rails param parser will simply use the number 3 and
44.
▲
by
padseeker
4y ago
With ROR it might be transformed via the params parser. If you enter the code below in plain old Ruby environment, like irl or the console, it will properly parse it; "3.9e3".to_f => 3900.0 Something happens when submitting web
45.
▲
by
padseeker
4y ago
Just read the article. A big part of the article that I can summarize is I don't set the requirements, someone else does. Every project is different. You might be fine with just integers. However I've been tasked with much more co
46.
▲
by
padseeker
4y ago
FYI - I wrote the article, happy to answer any questions
47.
▲
by
padseeker
4y ago
I heard this episode of How I built this, about company Quaise on how they plan to drill to unprecedented depths using new technologies involving drilling with microwaves to be able to tap into geothermal energy. The idea of repurposing coa
48.
▲
Startup to drill deepest holes ever to unlock nearly limitless geothermal energy
(wondery.com)
37 points
by
padseeker
4y ago
|
15 comments
49.
▲
by
padseeker
4y ago
Hey I just wrote a blog post of why the number input is terrible; https://blog.keenforms.com/why-the-number-input-is-the-worst... I also shared it on hacker news. I hope this helps.
50.
▲
Why the number input is the worst input
(blog.keenforms.com)
3 points
by
padseeker
4y ago
|
0 comments
51.
▲
by
padseeker
4y ago
That's a fair comment. I'll try to do that for a future blog post. I could probably write a detailed article for each particular feature. That would take some time. Thanks for the feedback and comment.
52.
▲
by
padseeker
4y ago
If there is anything I can do to help let me know. There is a learning curve, understanding how the form builder works takes a little time. What were you looking to do that you have problems with?
53.
▲
by
padseeker
4y ago
I think what you did is awesome. Its a great idea.
54.
▲
by
padseeker
4y ago
You cannot make a webpage that has dynamic interactions and responds the way a desktop application does WITHOUT Javascript unless you reload the page AFTER EVERY INTERACTION, and the page reload screen blip is visually disorienting. folkhac
55.
▲
by
padseeker
4y ago
So I started writing code for this back in 2017, and I discovered a lot of issues with the number input back in 2019 so I never revisited it. So I'm glad certain issues have been resolved, but there are still others. I could probably w
56.
▲
by
padseeker
4y ago
OMG you're my hero. The number input is quantifiably AWFUL
57.
▲
by
padseeker
4y ago
thanks I really appreciate that
58.
▲
by
padseeker
4y ago
thanks I'll check it out. There will always be something that will be beyond reach for SaaS, a level of customization beyond scope of my app. This just goes a few steps further.
59.
▲
by
padseeker
4y ago
thanks man, I appreciate it.
60.
▲
by
padseeker
4y ago
I'll see what I can do, but HONESTLY the number input has issues. I should write an article about it. I get what you are saying. However sometimes you have to circumvent the limitations of the browser to get it to do what you want it t
More ›