Re: General question about what is possible re: AS driving JavaScript
Re: General question about what is possible re: AS driving JavaScript
- Subject: Re: General question about what is possible re: AS driving JavaScript
- From: "Gary (Lists)" <email@hidden>
- Date: Sat, 16 Jul 2005 21:38:13 -0400
"Bill Planey" wrote:
> On 7/12/05 8:18 PM, "Malcolm Fitzgerald" <email@hidden> wrote:
>
>> To build the URL you concatenate (1) the domain name and (2) the action
>> and (3) the field key/value pairs
>>
>> http://www.domain.com/cgi-bin/info.cgi/ChangedAddress?
>> street=33+Lilly+st&location=Redfern&state=NSW&postcode=2012
>>
> Well, actually I made it partially work on one of the pages; the thing that
> worked is the fields getting filled in. There is still the matter of
> automating the pressing of the SEARCH button and there's also a popup menu
> that allows selection of a county; even though I found the field name for
> that popup and gave it a value different from the last-used value, it did
> not change it. So there must be some other command(s) that need to be
> tacked on to the URL I concatenate that will do the SEARCH and the pop-up
> selection.
>
> Here is the code connected with the SEARCH button:
>
> <td><input type="submit" name="btnSearch" value="Search" id="btnSearch"
> tabindex="2" />
http://somedomain.tld/path/to/form.html?.......&btnSearch=Search
but see below.
> Here is the code connected with the county pop-up:
>
> <td><select name="ddlCounty" onchange="__doPostBack('ddlCounty','')"
> language="javascript" id="ddlCounty" tabindex="1">
The field is changed (and redisplayed) by a JS event 'onChange'. Since you
are not sending the 'onChange' event, you will not see a redisplay of the
selected choice. That's fine.
http://somedomain.tld/path/to/form.html?.......&ddlCountry=COUNTRY&btnSearch
=Search
where 'COUNTRY' is one of the values from the <OPTION...>'s of the
<SELECT...>.
> Do you think I'll need to actually pass a javascript command to the browser
> in order to do these other things, or can the command somehow be made part
> of the URL?
You might, depending on all the factors. You can do that via AS if the
browser supports a 'do script' or 'do JavaScript' command (or similarly
named).
The general event looks like: formName.submit();
Browser specifics may require a more detailed DOM targeting, such as:
document.formName.submit() but you get the general idea. The final
event/method is at the right end, the DOM path is built from left to right,
with all the targeted elements in the DOM path to the form.
HTH
--
Gary
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden