osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 
 

Javascript and separate price per customer problem.

This is a discussion on Javascript and separate price per customer problem. within the osCMax v1.7 Discussion forums, part of the osCMax v1.7 Forums category; I'm not a javascript brainiac, and am having some problems integrating a VERY simple code in the "add/edit product" area. ...


Go Back   osCommerce and osCMax shopping cart software forums > osCMax v1.7 Forums > osCMax v1.7 Discussion

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Closed Thread

 

LinkBack Thread Tools
  #1  
Old 11-24-2003, 09:51 PM
Lurker
 
Join Date: Nov 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
gobayview
Default Javascript and separate price per customer problem.

I'm not a javascript brainiac, and am having some problems integrating a VERY simple code in the "add/edit product" area. I want to add a button next to the "group price" that when clicked calculates the group price as a percent of the retail price (I haven't yet had success with Easy Populate including that info). My problem comes from the fact that the separate price per customer field name contains square brackets, and this complicates the javascript code. I've looked into escaping the characters in the script, utilizing special characters for '[' and']', and treating the form field as an element referenced by index, all to no avail. The imortant part of the code follows. Could someone PLEASE just tell me what to change to make this work. I've spent way to much time on this simple problem.

Quote:
<html>
<head>
<script>
function CalcDiscount()
{
var RetailPrice = eval(document.new_product.products_price.value)
var Discount = .75
document.new_product.sppcprice[1]; = RetailPrice * Discount
}
</SCRIPT>

</head>

<body>

<form name="new_product">
<input type="text" name="products_price" size="4"><br><br>
<input type="text" name="sppcprice[1]" size="4">
<input type="button" value="Recalculate" onClick="CalcDiscount()">
</form>

</body>

</html>
Thank in advance,
Spice
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Sponsored Links
Advertisement
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Separate Price per customer additional price box auntie22 osCMax v1.7 Discussion 0 06-05-2006 08:12 AM
Where is Separate Pricing Per Customer? adam71o osCMax v1.7 Installation 11 06-03-2005 12:25 PM
Separate Pricing Per Customer 4.1.1 - New version fuzzyphil osCMax v1.7 General Mods Discussion 1 05-04-2005 08:39 AM
Separate Price per Customer ganast osCMax v1.7 General Mods Discussion 2 01-26-2005 09:29 AM
EasyPopulate used with Separate Price per Custo mat123slade osCMax v1.7 Discussion 0 10-18-2004 11:10 AM


All times are GMT -8. The time now is 12:32 AM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax