what did you expect ? the ajax function serializes any input with that
"name" attribute, so it's doing exactly what you're asking it to do.
plus, you're attaching inline events to 2 inputs for every form
loaded.......... lots of markup wasted for a very simple
thing....moreover.... what the heck is it doing that function? what if the
user switch fields with tabs instead of clicking ??? that's so old school
and error prone given that there are far better solutions that I really
don't know why people bother still with inlined events.
Anyhow, assuming you really want only clicks on the two fields to submit
the data stored into the hidden fields....completely not tested, but it
should be close
$(function() {
$(body).on('click', 'input[name=titel],input[name=bemerkung]', function
() {
var form = $(this).closest(form);
var jmid = form.find('input[name=jmid]');
var pid = form.find('input[name=pid]');
$.ajax({
type: "POST",
url: '../../evlist'
data: {'jmid' : jmid, 'pid' : pid}
success: function (msg) {
$("#events').html(msg);
}
}); })
})
<tl;dr> if you're throwing yourself to a rich ajax application, do yourself
a very big favour and drop for a second python and learn just a little
javascript. It's not as pretty but that's what we need to work with, and it
will make your code smaller, easier and less ugly.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.