Guuk Guuk - 1 year ago 121
HTML Question

Mechanize - Submit form without click on submit button

Using Mechanize I fill a fom and I want to submit it without clicking on the submit button

<formulaire POST https://WWW/YYY/XXX.php application/x-www-form-urlencoded
<HiddenControl(type=traitement) (readonly)>
<HiddenControl(uid=zzzzz) (readonly)>
<HiddenControl(no_tt=1) (readonly)>
<SubmitControl(bouton_m=ttttt) (readonly)>
<SubmitControl(bouton_m=uuuuu) (readonly)>>

In fact the submitting is achieve using
function for the
form and it calls a
function in JS:
. I want to do the same thing, i.e. submitting the form without clicking on any
button (this button allows to quit the website) but just by submitting using POST.

Answer Source

The solution for this issue was to disable the two SubmitControl using the following syntax:

for control in br.form.controls:
    if control.type == "submit":
        control.disabled = True

The line control.disabled=True enables you to disable the two submit button (with label=submit)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download