|
|
Hi, I have a photography website and am trying to set up a shop for it, but I have no knowledge of web programming, I have found a shop that uses java script (I don't want anything more advance)
The shop has a list of items that have a checkbox next to them, when you click the checkbox its adds up the total cost of the order in a box at the bottom, but being a photography site I need the checkboxes to be drop down lists so the customer can select the size of print that they want. I don't know how to make each list option have a cost attached to it. Below is the source code for the shop, if anyone can understand what I am talking about and is willing to help I would be very greatfull.
<script language="JavaScript">
var Cost, Grand_Total;
function tally()
{
Cost = 0;
if (document.orderform.Item1.checked) { Cost = Cost + 26.15; }
if (document.orderform.Item2.checked) { Cost = Cost + 26.10; }
if (document.orderform.Item3.checked) { Cost = Cost + 26; }
document.orderform.Total.value = "£" + Cost;
}
function pound (amount)
{
amount = parseInt(amount * 100);
amount = parseFloat(amount/100);
if (((amount) == Math.floor(amount)) && ((amount - Math.floor (amount)) == 0))
{
amount = amount + ".00"
return amount;
}
if ( ((amount * 10) - Math.floor(amount * 10)) == 0)
{
amount = amount + "0";
return amount;
}
if ( ((amount * 100) - Math.floor(amount * 100)) == 0)
{
amount = amount;
return amount;
}
return amount;
}
</script>
<form method="post" name="orderform" action="mailto:me@mydomain.com" enctype="text/plain"">
<table border="0">
<tr>
<td colspan="2"><p>
<input type="checkbox" name="Item1" value="Item1_chosen" onclick="tally()" />
Item One (£26.15) </p>
<p>
<input type="checkbox" name="Item2" value="Item2_chosen" onclick="tally()" />
Item Two (£26.10) </p>
<p>
<input type="checkbox" name="Item3" value="Item3_chosen" onclick="tally()" />
Item Three (£26) </p>
<p>
<label>
<select name="prints">
<option>Option</option>
<option value="Print1">Print 1</option>
<option value="Print2">Print 2</option>
<option value="Print3">Print 3</option>
</select>
</label>
</p>
<p> </p></td>
</tr>
<tr>
<td> Total</td>
<td><input type="text" name="Total" value="£0" size="7" /></td>
</tr>
<tr>
<td>Contact Name:</td>
<td><input name="Name" type="Text" id="Name" size="20" /></td>
</tr>
<tr>
<td>Address</td>
<td><input type="Text" name="Street" size="20" maxlength="40" /></td>
</tr>
<tr>
<td>City</td>
<td><input type="Text" name="City" size="20" maxlength="20" /></td>
</tr>
<tr>
<td>Post Code</td>
<td><input type="text" name="Code" size="9" maxlength="10" /></td>
</tr>
<tr>
<td>Email Address</td>
<td><p>
<input type="Text" name="Email" size="30" maxlength="30" />
</p> </td>
</tr>
<tr>
<td colspan="2" height="3"><hr /></td>
</tr>
<tr>
<td colspan="2" align="center"><input name="Submit" type="Submit" value="Send Order" />
Or
<input name="RESET" type="reset" value="Reset Order" /></td>
</tr>
</table>
</form>
|
|
|
|
|
Do not try write your own shop if you do not understand how to develop. Monetary functions need to be handled with the greatest of care.
Brad
Australian
- Bradml on "The ADOTD"
Hey all, did you just use/read an acronym? Pots it HERE, at the ADOTD[^]
|
|
|
|
|
You should never do anything in javascript that isn't double checked on the server side. And, like Brad said, you probably should pay someone to do this, rather that try to learn web development over a weekend. Especially where money is involved.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I want to know how i can integrate a J2EE app with microsoft Sharepoint.
Vikram Verma
|
|
|
|
|
|
Can anyone Please let me know the way of integrating J2EE with Microsoft Share point???? Iam are doing it for one of our vendors??Any help is greatly appreciated....
|
|
|
|
|
Well when it comes to ISAPI I am totaly lost, I dont know how it works how to implement it , all I know it is great for SEO (Search engine optimization).
All pageurl's work like
www.mysite.com/default.aspx?pageId=1
And it should look like
ww.mysite.com/Page1/index.html
Can someone help me or point me to a good tutorial.
Le Roux Viljoen
Web Developer
PCW New Media
South African Branch
www.pcwnewmedia.com
|
|
|
|
|
I have found the solution but coming back here because I hate leaving a thread without a answer.
I have found a article
http://msdn2.microsoft.com/en-us/library/ms972974.aspx[^]
this explains multiple ways of rewriting your url's to search engine friendly versions, it is 18 pages long but every bit worth going through
Le Roux Viljoen
Web Developer
PCW New Media
South African Branch
www.pcwnewmedia.com
|
|
|
|
|
Hi guys I don't know if anyone can help me but I have a piece of javascript that gets the window dimensions and places the content in the middle, but when I run my app in firefox it doesnt even seem to execute the javascript.
<script language="JavaScript" type="text/jscript" >
<!--
function setHeight(){
document.getElementById("bodyContent").style.visibility = "hidden";
var myWidth = 0, myHeight = 0;
if( typeof( window.innerWidth ) == 'number' ) {
//Non-IE
myWidth = window.innerWidth;
myHeight = window.innerHeight;
} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
//IE 6+ in 'standards compliant mode'
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
//IE 4 compatible
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight;
}
//window.alert( 'Width = ' + myWidth ); //Show When Debugging
//window.alert( 'Height = ' + myHeight ); //Show When Debugging
//Set Height of Table
document.getElementById("placeholderTable").style.height=(myHeight-50)+"px";
document.getElementById("RadMenu1").style.height = 2+"px"
document.getElementById("RadMenu1").style.height = 28+"px"
document.getElementById("bodyContent").style.visibility = "visible";
document.getElementById("bodyContent").style.display = "block";
alert("hello");
}
-->
<!-- ============================= -->
</script>
This is executed on my body's onload() event.
Please help!
Le Roux Viljoen
Web Developer
PCW New Media
South African Branch
www.pcwnewmedia.com
|
|
|
|
|
Open the error console in Firefox so that you see what error message you get when you open the page.
---
single minded; short sighted; long gone;
|
|
|
|
|
Would it not maybe be simpler to do this using CSS markup?
|
|
|
|
|
Dont worry about this one , all I did was change the <script> tag to
<SCRIPT LANGUAGE="JAVASCRIPT"> and it seemed to work.
thanx
Le Roux Viljoen
Web Developer
PCW New Media
South African Branch
www.pcwnewmedia.com
|
|
|
|
|
I see. Now I noticed that you used the type "text/jscript" in the script tag. JScript is the Microsoft variation of Javascript, and only exists in Internet Explorer. Use this tag instead:
<script type="text/javascript">
---
single minded; short sighted; long gone;
|
|
|
|
|
Thanx,
I was just being lazy, its strange how sometimes we dont care how it works until it doesnt work at all.
I am a bit new to creating software that is multibrowser compatible, but slowly and surely I am getting there, I will add that tip to my notebook.
Le Roux Viljoen
Web Developer
PCW New Media
South African Branch
www.pcwnewmedia.com
|
|
|
|
|
Hi I am havin trouble tryin to register javascript on an asp.net page I am using an aspx page to display whatever .ascx file has been selected. I am tryin to open a new window using this function on the aspx page
public void PopupWindow(string url)
{
string script = string.Format("window.open('{0}', '_blank');", url);
Page.RegisterStartupScript("OpenWindow", script);
}
but when I try to use it from the .ascx pages it does not open a new window any help or ideas would be appreciated
Thanks
Tim
|
|
|
|
|
The page has to have a form tag with runat="server" so that Page.RegisterStartupScript has somewhere to put the script.
---
single minded; short sighted; long gone;
|
|
|
|
|
|
Looks to me like the Form declaration is the problem. You've qualified it with your own namespace - it's not necessary - a simple will do
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Hi there,
I am making a web application in html having a dynamic dropdown control by Javascript.
My problem is, The combobox is showing the data in ie but not in FireFox.
I don't know why? If you know then please tell me that how can I solve this problem.
Thanks in advance.
--------------------------------------------------------------------------------------------------
Hiral Shah
India
If you think that my question is good enough and can be helpful for other then don't forget to vote.
|
|
|
|
|
View the html code generated in firefox to anylyze the problem...
<< >>
|
|
|
|
|
how to display an card as in a face up mode when it is in a face down mode
|
|
|
|
|
1. Put finger under card.
2. Raise finger until center of gravity of card topples it.
3. Done.
|
|
|
|
|
Is it a good idea to have my Data Access Layer on Web Service?
What I mean is, All communication of different tier with the underlying database must all be done using XML web sevices.
What are the Cons and Pros of my idea?
Thanks in Advance.
|
|
|
|
|
Hi,
I have a select list that gets populated from the DB. When the user makes a selection I am able to retrieve this value via Request.Form(...)
However, I am wondering if you can retrieve the text value using ASP?? I know this can be done in JavaScript using the options text attribute, but it is possible in ASP?
Any input would be appreciated....Thanks!
|
|
|
|