Ctrl + Enter should submit the comment/ticket

Assigned to
2 years ago
1 year, 4 months ago
No labels applied.

~benharri 1 year, 6 months ago

Is there a way to do this without javascript? I've only been able to fine javascript solutions to this in my first searches.

~jehanne 1 year, 6 months ago

Good question!

To my knowledge, without JavaScript, all you can do is to add an access key to an input submit.

Something like

<form ...>
<input type="submit" accesskey="S" value="Submit"/>

would submit the form by typing Alt+Shift+S.

Not exactly Ctrl+Enter, but something people can learn.

~sircmpwn 1 year, 6 months ago

I'm okay with using JavaScript for little details like this. The site has to be useful and pleasant without JS, but we can use small amounts of JS to improve QoL here and there.

We can also set up that accesskey thing, seems neato.

~jehanne 1 year, 6 months ago

Progressive enhancement is a forgotten art I was initiated to a more than a decade ago.

I would argue that with simple explanatory divs one could enhance the quality of life without invoking Balrogs that potentially threat the users security.

However since people using your services is already trusting you (and Let's Encrypt and everyone who has physical access to your servers), few lines of JavaScript shouldn't extend the attacks surface too much.

If I can give a suggestion though, I'd appreciate if you avoid any javascript framework, avoid CDNs, and possibly keep javascript constrained to what can fit the page source, in the script tag, without triggering further request to load further js or json.

It's not just a matter of security: the overall rendering will be faster and the experience better.

But above all, as a hack for hackers, it would be funny to see the mainstream wisdom that the world would collapse in fire if JavaScript were opt-in, challenged by a great service.

~ihabunek 1 year, 4 months ago

This comment was submitted by pressing Ctrl+Enter.

~sircmpwn REPORTED IMPLEMENTED 1 year, 4 months ago

~benharri 1 year, 4 months ago


Register here or Log in to comment, or comment via email.