|
From: Jamie C. <jca...@we...> - 2006-06-20 18:30:12
|
On 20/Jun/2006 12:50 Noah Romer wrote ..
> What does it take to make the output of file_chooser_button() actually
> popup a
> window? Calls to file_chooser_button work fine in existing modules (such
> as
> apache/htaccess.cgi). In code that I'm writing, file_chooser_button appears
> to output the correct html/js, but clicking on the resulting button does
> nothing.
>
> The code pulls in web-lib.pl, web-lib-funcs.pl, ui-lib.pl and
> javascript-lib.pl. The first form on the page uses the date_chooser_button()
> function, and that works fine.
>
> The relevant HTML (rather ugly) looks like:
>
> <form METHOD="POST" ACTION="defbb.cgi" ENCTYPE="multipart/form-data"
> NAME="restoreform">
> <table width="100%" id="restore-form"><input type="hidden"
> name="restoreinited" value="true">
> <tobdy>
> <tr><br><br></tr>
> <tr><input type="radio" name="fm" value="1" title="Restore only if entire
> bundle validates." checked="on">Failure Mode 1</tr>
> <tr><input type="radio" name="fm" value="2" title="Parse message bundle
> and
> restore individual messages that validate.">Failure Mode 2</tr>
> <tr><input type="radio" name="fm" value="3" title="Restore even messages
> that
> don't validate if there's no valid copy on disk.">Failure Mode 3</tr>
> <tr><td width="70%"><table width="100%"><tr><td width="70%"><table
> width="100%"><tr><input name="bfilename"><input type=button onClick='ifield
> =
> form.file; chooser =
> window.open("/chooser.cgi?add=0&type=1&chroot=/&file="+escape(ifield.value),
> "chooser", "toolbar=no,menubar=no,scrollbar=no,width=400,height=300");
> chooser.ifield = ifield; window.ifield = ifield' value="...">
> </tr>
> <td valign=top colspan="2"><input type="submit" value="Restore
> Bundle"></td></tobdy></table></form>
Do you have more than one form on your page? If so, you need to pass the
form number as the third parameter to file_chooser_button.
- Jamie
|