On Monday 19 August 2002 12:12 pm, you wrote:
> Hi list,
>
> We have a report on our intranet, with a <form> at the top which lets the
> users choose the dates on which to base the report and allows them to set a
> simple filter (screen grab of the top of the report at
> http://laughing-buddha.net/tmp/report.gif). The combo boxes on the form
> that control the dates are called "sd", "sm", "sy", "ed", "em" and "ey".
>
> For each row of the output there are a couple of icons allowing users to
> zoom into the section and get a more detailed report. Each of the "zoom"
> links looks something like this:
>
> <a href="zoom.php?id=1&sd=16&sm=8&sy=2002&ed=16&em=8&ey=2002">
>
>
> I don't think I can solve this server-side, so (unless someone can come up
> with a better idea) I'm after a fast client-side way to dynamically rewrite
> these links if the values in the combo boxes change.
>
> Any ideas? Alternative solutions gratefully received as well :-)
Hi Jon,
I'm guessing that the "id=1" part of the link you showed refers to the
section that the link zooms in on. How about changing the link to something
like:
<a href="javascript:zoomReport(1)">
to call the function shown below? You could also keep the links the way they
are but add onClick="zoomReport(1); return false;"> so that non-Javascript
browsers will still get the static URL written out by your server-side
script. The "1" parameter would be the ID value to pass over.
function zoomReport(id) {
sd = document.FormName.sd.options[document.FormName.sd.selectedIndex].value;
sm = document.FormName.sd.options[document.FormName.sm.selectedIndex].value;
sy = document.FormName.sd.options[document.FormName.sy.selectedIndex].value;
ed = document.FormName.sd.options[document.FormName.ed.selectedIndex].value;
em = document.FormName.sd.options[document.FormName.em.selectedIndex].value;
ey = document.FormName.sd.options[document.FormName.ey.selectedIndex].value;
newurl = "zoom.php";
newurl = url + "?id=" + id + "&sd=" + sd + "&sm=" + sm + "&sy=" + sy;
newurl = url + "&ed=" + ed + "&em=" + em + "&ey=" + ey;
document.location = newurl;
}
Obviously "FormName" in the code above is the name of the form on the page.
It's a bit clunky, but ought to do the trick for you!
HTH
Dave P
>
> Cheers
> Jon
>
>
> Witan Jardine
> 13 Southampton Place
> London WC1A 2AL
> Tel: 020 7404 4004
>
> Please visit us on the Internet:
> http://www.witanjardine.co.uk/
>
> 'The information included in this e-mail is of a confidential nature and is
> intended only for the addressee. If you are not the intended addressee,
> any disclosure, copying or distribution by you is prohibited and may be
> unlawful. Disclosure to any party other than the addressee, whether
> inadvertent or otherwise is not intended to waive privilege of
> confidentiality. If you have received this email in error, please forward
> it to [EMAIL PROTECTED], thank you.'
>
>
> ____ � The WDVL Discussion List from WDVL.COM � ____
> To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED]
> Send Your Posts To: [EMAIL PROTECTED]
> To change subscription settings to the wdvltalk digest version:
> http://wdvl.internet.com/WDVL/Forum/#sub
>
> ________________ http://www.wdvl.com _______________________
>
> You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]
> To unsubscribe send a blank email to %%email.unsub%%
--
Dave Presh
http://www.preshweb.co.uk/
[EMAIL PROTECTED]
____ � The WDVL Discussion List from WDVL.COM � ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED]
Send Your Posts To: [EMAIL PROTECTED]
To change subscription settings to the wdvltalk digest version:
http://wdvl.internet.com/WDVL/Forum/#sub
________________ http://www.wdvl.com _______________________
You are currently subscribed to wdvltalk as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]