Here is a living example of my problem
http://jsfiddle.net/littlesandra88/xksB9/
I would expect the Create button to return an empty string when its radio buttons are not selected. Instead, it reads the value from the switches from the form below.
The bottom "Save" button always returns the value from the form above. Very strange!
Here is the code
$(document).ready(function(){
$('form').live('submit', function(){
var title = this.elements.title.value;
var owner = this.elements.owner.value;
var type = $('input:radio[name=ctype]:checked').val() || '';
alert(type);
});
});
The idea is that I will automatically generate forms of the type below, and therefore I donβt know the identifier before hand, so I just give them random numbers to make them unique.
How to solve this problem?
source
share