ClientForm .click() oddity

G

Gordon Airporte

I've written a script using ClientForm to automate opening and closing
ports on my Linksys router. It works, but I wonder if there isn't a
better way to do it.
The problem is that the list of arguments in the request generated by
..click()ing the form is incomplete and I have to edit it manually. The
Submit button on the form is created with the following code:

<script>document.write("<input type=button name=save_button" + "
value=\"" + sbutton.save + "\" onClick=to_submit(this.form)>");</script>

Which calls this function in the form source:

function to_submit(F)
{
F.submit_button.value = "Forward";
F.action.value = "Apply";
F.submit();
}

Simply .click()ing on the form does not properly fill in
submit_button=Forward&action=apply, however. The arguments are there but
with no values.
Is this because ClientForm doesn't run javascript, or is there a way to
determine and fix these values without manually editing the .data string
of the Request with values I have to find on my own?
 
J

John J. Lee

Gordon Airporte said:
Simply .click()ing on the form does not properly fill in
submit_button=Forward&action=apply, however. The arguments are there
but with no values.
Is this because ClientForm doesn't run javascript,
Yes.


or is there a way
to determine and fix these values without manually editing the .data
string of the Request with values I have to find on my own?

No. (Strictly, it shouldn't be necessary to actually edit the data
string -- you should be able to use the API to do it -- but I'm not
sure that's fully documented and tested, so that may not work
correctly. Either way, you have to do it manually.)


John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top