question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[minor improvement] hidden inputs in the pay button html form take space in the page

See original GitHub issue

I noticed that the input of type hidden in the pay button form, while invisible, still take some space in a page.

I tested it with Firefox 62.0 and Opera 56.0.3051.36.

This can be annoying when you add more optional inputs and/or try to fit the pay button in a contrived space, for example a page footer in my case, as it add seemingly “blank” space on top of the button.

Only solution I came up with was to add a <div style="display: none;"> around the hidden lines (excluding the image obviously). For example :

<form action="https://btcpay.sosthene.net/api/v1/invoices" method="POST">
<input style="width: 209px;" alt="Pay with BtcPay, Self-Hosted Bitcoin Payment Processor" name="submit" src="https://btcpay.sosthene.net/img/paybutton/pay.png" type="image" />
<div style="display: none;">
<input name="storeId" type="hidden" value="2kUDmoLQMrwvxansY2YkhSaKoo2Y91skauJjtfVqzDYH" />
<input name="price" type="hidden" value="10" />
<input name="currency" type="hidden" value="USD" />
<input name="email" type="hidden" value="USD" />
<input name="currency" type="hidden" value="USD" />
</div>
</form>

I don’t know if there is downside to this solution, or a more obvious, simpler way to achieve this result. If not, I’d like to propose a pull request to add this by default when the button’s code is generated.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Kukkscommented, Oct 6, 2018

I see that there are <br/> tags generated on your form after each input. You might have a script in your wordpress generating the extra html on input fields in forms…

0reactions
rockstardevcommented, Oct 11, 2018

❤️

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to hide elements without having them take space on ...
I'm using visibility:hidden to hide certain elements, but they still take up space on the page while hidden. How can I make them...
Read more >
How to hide an HTML element, but still have it take up ...
visibility: hidden hides the element, but it still takes up space in the ... How do you layout html elements to always line...
Read more >
<input type="hidden"> - HTML: HyperText Markup Language
Warning: While the value isn't displayed to the user in the page's content, it is visible—and can be edited—using any browser's developer tools ......
Read more >
Hidden Fields Adding White Space - HTML & CSS
Hi guys I have two hidden fields on a form, and for some reason they're adding extra white space to the final page...
Read more >
How to eliminate extra space before and after a <form> tag
In this article, we are going to learn how to eliminate the extra space after a form tag in HTML. Approach 1: We...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found