I am using form2js.js for converting my form data into a JSON object.
Here is the code:
var loginData = form2js('loginForm', '.', true);
console.log("FormData=" + JSON.stringify(loginData));
But the JSON String is empty. loginform is the ID of my form. I have searched for help on but I am not getting anything.
Here is the HTML form:
<form action="index.html" class="padder" id="loginForm" name="loginForm">
<label class="control-label">User</label>
<input id="userId" type="text" placeholder="User ID" class="form-control">
<input type="password" id="password" placeholder="Passcode" class="form-control">
<button type="submit" id="signInBtn" class="btn btn-info">Sign in</button>
</form>
The problem seems to be the missing
name
attributeDemo: Fiddle