Skip to content

Commit

Permalink
Fix form with no id attribute but a form element with name="id".
Browse files Browse the repository at this point in the history
  • Loading branch information
atomatt committed Mar 31, 2011
1 parent e968391 commit ffa5cc4
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion formish/js/formish.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function renumber_sequences(o) {
}

function renumber_sequence(o) {
var formid = $(o).attr('id');
var formid = formish_form_id(o);
var N = {};
o.find('.type-sequence.widget-sequencedefault').each( function () {
field_id = $(this).attr('id');
Expand Down Expand Up @@ -126,6 +126,17 @@ function renumber_sequence(o) {

}

/*
* Find the form element's id attribute.
*/
function formish_form_id(form) {
var formid = $(form).attr('id');
if (typeof(formid) != typeof('')) {
formid = ''
}
return formid;
}

function add_new_item(t,o) {
// Get the encoded template
var code = t.next('.adder').val();
Expand Down

0 comments on commit ffa5cc4

Please sign in to comment.