Cannot get applescript to click image

I have read every do javaScript thread concerning Safari and still cannot figure this out.

I have a page with a “continue” image at the bottom. The HTML is:


Previous
Clear

Continue

Using do JavaScirpt how do I get it to click the button which submits form data? I have been stuck on this for days. Is it even possible?

tell application "Safari"
	do JavaScript "onCreateSubmit('Next')" in document 1
end tell

As you see, when you click the image, the function “onCreateSubmit” is called. As it is a function available to the document, you can invoke it yourself from your “do JavaScript” command…

Thank you. How simple. Just shows how much I am fumbling around in the dark with this stuff.

I also had a previous post with not reply that I’m sure you could answer. I am using

do JavaScript "window.document.forms[2].elements[5].value='" & firstname & "';" in document 1

to populate a form. I cannot figure how to click a checkbox, radio button or drop down value menu using the same. The page HTML is:

<input type=“radio”
id =“customer_own_residence”
name =“customer_own_residence”
value = “Y”
“”>

Thank you in advance. If you know of any good books on this stuff I would appreciate a recommendation.

http://scriptbuilders.net/category.php?search=sfri
If you are interested, this one includes a open-source script called “sfri Library”, which includes a script object called “Formularios”, which can teach you to manipulate any form element in a web page. There is also documentation and examples.
Basically, answering your question, for radio/checkbox elements, you set their “checked” property to “true” or “false”. For selects (dropdown menu, list-box), you set its “selectedIndex” property (eg, number “0” is the first item in the list).
Appart from this, any website talking about javascript is OK. I like this one:
http://www.devguru.com/Technologies/ecmascript/quickref/javascript_index.html