Created
February 21, 2014 07:26
-
-
Save chrisamoore/9130166 to your computer and use it in GitHub Desktop.
Dag Gum How do I iterate over this HTML and Make a JS call?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form method="POST" action="http://frontline.dev/appointments/4" accept-charset="UTF-8"> | |
<input name="_method" type="hidden" value="PATCH"> | |
<input name="_token" type="hidden" value="PROPCMA5b4UC4SNexoexu2ANst1a1OLo7bjJTYzk"> | |
<input name="appointment_time" type="hidden" value="2014-02-20 13:00:00"> | |
<input name="status" type="hidden" value="ARRIVED"> | |
<div class="btn-group actions"> | |
<a class="status-btn btn " data-action="confirm">Confirmed</a> | |
<a class="status-btn btn btn-info " data-action="arrived">Arrived</a> | |
<a class="status-btn btn " data-action="complete">Completed</a> | |
<a class="status-btn btn " data-action="canceled">Cancel / refund</a> | |
<a class="status-btn btn " data-action="canceled">reschedule /schedule</a> | |
</div> | |
<input class="btn btn-info" type="submit" value="Update"> | |
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var obj; | |
$('form').children().each(function(k,v){ | |
obj = { | |
v.name: v.value | |
}; | |
}); | |
console.log(obj); | |
// Have to fill out this OBJ. w/ the HTML above | |
$.ajax({ | |
url: '', | |
type: 'post', | |
data: {}, | |
success: function (data) { | |
data | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment