In the following example I get title from this form using html id=title.
How do I do the same, but instead of using ID then using name?
$(document).ready(function(){
$('form').live('submit', function(){
var aform = $('form[name="create_form"]');
// get the entire form
var form = $(this);
// get form title field by ID
var title = this.elements.title.value;
// get selected radio button using name instead if ID
var type = $(this).find('input:radio[name="ctype"]:checked').val() || '';
alert(title);
In the case of the radio button, is it gotten by name, but I can’t figure out how to translate that syntax to a normal form field of
<input name="title" id="55544_title" type="text" />
in this line
you are not getting it with the id, you are getting it with the name attribute, so in some way you are already doing it correctly