On Monday 23 February 2004 13:43, CLIFFORD ILKAY wrote:

> Thank you David. Do you generate the JavaScript using Python or do you hand
> code it? What about generating XUL? It seems to me that Mozilla's XUL
> offers a rich array of widgets and events, which would be perfect for this
> sort of thing.

Here's how I do something similar to what you want:

Let's say I have a webpage for invoices, the invoice has a field for part 
number.  Beside that field can be a link "search for parts", the href would 
be something like this:

    javascript:FindInfo('partsearch.html?formname=order&fieldname=partno');

The parameters being passed are the name of the form and the name of the field 
in the form that we wish to populate.  The invoice page contains the 
following snippet of javascript implementing the FindInfo function:

    <script language="Javascript1.1">
        function FindInfo(url,HelpWindow) {
        HelpWin = window.open(url,'HelpWindow',
            'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,
            resizable=0,width=500,height=300'); }
    </script>

The popped up page (partsearch.html) implements whatever search form you need 
to find your parts and returns a list of parts.  The partnumbers are 
clickable and their href looks like this:

    javascript:setField('2024');

partsearch.html has the following javascript that implements the setField 
function:

  <script language="Javascript1.1">
      function setField(value) {
        window.opener.document.order.partno.value = value;
        self.close();
    }
  </script>

Click on any of the search results and the partnumber populates the partno 
field from the order form on the invoice page, the popup then closes itself.

I've used this on a number of sites and I've never had problems with it.  I've 
tested such code on IE6, AOL, mozilla (windows and Linux) and Konqueror.  
AFAIK it works even in much older browsers, pretty much anything with 
Javascript support (I suppose javascript1.1 though I don't recall if that's a 
real dependency).

I wouldn't use XUL or any other technology that locks a user to a specific web 
browser.  The functions I gave are static with the exception that you need to 
set the form and field names.

-- 
Fraser Campbell <[EMAIL PROTECTED]>                 http://www.wehave.net/
Georgetown, Ontario, Canada                               Debian GNU/Linux


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to