[FX.php List] Creating summaries on the fly,

Kevin Futter kfutter at sbc.melb.catholic.edu.au
Tue Aug 22 21:44:55 MDT 2006


On 23/8/06 1:06 PM, "Bob Patin" <bob at patin.com> wrote:

> Thanks for the reply.
> 
> Unfortunately, that won't work, since I have no way of knowing how many
> subsummaries there will be, or how many totals there will be for each
> category.
> 
> I originally thought about doing this in the database itself, but summarizing
> in PHP works great. The only catch is these percentages...
> 
> At this point I'm not too concerned about the non-Javascript folks; if they
> want to use the reports and get all the data, they'll have to have Javascript.
> The question is, how to plug a piece of text into a page. 
> 
> I know how to populate a form field in JS, but how do I insert a piece of text
> somewhere in an HTML (actually of course PHP) page?
> 
Well, probably the simplest method would be to create an empty element on
the page to contain the percentage info ­ I don¹t know your page structure
so I¹ll leave it to you to decide what the most semantic choice of element
is. You¹ll need to give it an ID, so if you require more than one, append an
incrementing number to the ID name (eg, id-name1, id-name2 etc).

The JS would need to contain a line like so:

document.getElementById(³id-name1²).innerHTML = ³30%²;

I can elaborate further with a complete script example if you need it.

-- 
Kevin Futter
Webmaster, St. Bernard's College
http://www.sbc.melb.catholic.edu.au/



------------------------------------------
This e-mail and any attachments may be confidential.  You must not disclose or use the information in this e-mail if you are not the intended recipient.  If you have received this e-mail in error, please notify us immediately and delete the e-mail and all copies.  The College does not guarantee that this e-mail is virus or error free.  The attached files are provided and may only be used on the basis that the user assumes all responsibility for any loss, damage or consequence resulting directly or indirectly from the use of the attached files, whether caused by the negligence of the sender or not.  The content and opinions in this e-mail are not necessarily those of the College.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.iviking.org/pipermail/fx.php_list/attachments/20060823/155ce038/attachment-0001.html


More information about the FX.php_List mailing list