Check form data required before submission

pull/12/head
Sheng 7 years ago
parent 23f48e21e9
commit 02fbdab78d

@ -11,6 +11,11 @@ jQuery(function($){
type = form.attr('type'), type = form.attr('type'),
data = new FormData(this); data = new FormData(this);
if (!data.get('hostname') || !data.get('port') || !data.get('username')) {
status.text('Hostname, port and username are required.');
return;
}
var pk = data.get('privatekey'); var pk = data.get('privatekey');
if (pk && pk.size > 16384) { if (pk && pk.size > 16384) {
status.text('Key size exceeds maximum value.'); status.text('Key size exceeds maximum value.');

Loading…
Cancel
Save