Log in

View Full Version : Price quote generator for website



Neuterpets
05-31-2007, 02:00 PM
Hello, I am new to this forum, and it looks like the most promising place to ask this question. I am a petsitter, and would like to have a price quote generator like this one at http://www.geocities.com/siliatopetsit/ . I have emailed the sitter on that site, but she has not responded, and since her page was last updated in 2005, I don't think it's likely she will. I tried looking at the page properties/source, but that didn't help. Does anyone know how to do a script for that? I've searched all over the internet, and am empty handed. Help would be MUCH appreciated.
Thanks!
Beth T.

mburt
06-01-2007, 12:19 AM
Well, you could store the statements and prices in arrays and output them:

<div id="prices"></div>
<script type="text/javascript">
var unit = "$",
sep = ": ",
comments = ["Price 1","the second price"],
prices = ["25.00","683.36"];
for (var i = 0;i < comments.length;++i) {
document.getElementById("prices").appendChild(document.createTextNode(comments[i]+sep+unit+prices[i]));
document.getElementById("prices").appendChild(document.createElement("br"));
};
</script>