Dear Sir,

I got stuck in something.. I want to call a controller function
_onclick of a submit field. For example :

I used two ways:

1.
image1 = FORM (TABLE (TR(TD(INPUT(_type = "submit", _value =
"delete",_id="delete_button" ,
           _onclick= delete_image(id) ))))


OR:


image1 = FORM (TABLE (TR(TD(INPUT(_type = "submit", _value =
"delete",_id="delete_button" ,
           _onclick="javascript:
$.post(URL(r=request,c='default',f='delete_image')}})"))))

And in the same controller.. there will be a function :

def delete_image (id):
    print "image deleted-- : " + str (id)
    db(db.image.id==id).delete()
    print "deleted syccessfully"
    return True


It didn't work :(((((((((((((((((((((((((((((((((((((((

My question is: is that possible? or how could I call a controller
function onclick of submit button?

Abeer

Reply via email to