Re: Can't press a non-submit button
Date: Fri, 07 Sep 2007 09:27:26 +0200
Will Weatherford wrote:
> I can select an option from a pull down list:
> curl [...] https://220.127.116.11/[...]
I couldn't connect to the Lexmark host you mention, thus could make no use
of the command line you supplied. However, it looks correct.
> But I am unable to go to another web page, below, make some selections
> and press the "Add" "Modify" or "Delete" button. Here are my efforts:
> curl [...] -d 0.type=1 [...] -d 101.system.configurationScheduler=Add
Those name=value options look correct.
> curl [...] -d 0.days=2&press=Add [...]
"press" is not the name of an input field below.
(And there's no reason to mix `&'s and repeated -d)
> <SELECT NAME="0.type">
> <OPTION SELECTED VALUE="-1">----</OPTION>
> <OPTION VALUE="0">Print faxes</OPTION>
> <OPTION VALUE="1">Hold faxes</OPTION>
Thus, -d 0.type=1 selects the latter.
> <TR><TD><INPUT TYPE="HIDDEN" NAME="1.id" SIZE=22
> MAXLENGTH=16 VALUE=""></TD></TR>
Browsers don't display hidden fields (thus usually they don't have
sizes) but they do send those name=value pair to the remote host
(e.g. to keep state info when the form changes, similar to cookies.)
> <TD><input TYPE="submit" NAME="101.system.configurationScheduler"
> VALUE="Add"> </TD>
Thus, -d 101.system.configurationScheduler=Add performs the latter.
Where was the <Form> start tag? Look carefully at its action=URL
attribute: it is the location where the browser sends the data.
Often it is the same as the url that prepares the empty form,
but sometimes there are static html pages containing empty forms
that send them to a different url (e.g. in order to save server's
Also, you should watch for OnSubmit and OnClick attributes, in case
directly to the remote host bypassing the browser's built-in submit
(e.g. so that the browser stays on the same page while dynamically
changing some parts of it.)
Received on 2007-09-07