codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Applying discount  blkskull at 20:01 on Thursday, January 11, 2007
 

Hi:
I am writing a script for school and the script involves 3 dropdown lists of products. If a certain product is selected say a canon printer then there would be no tax on this item but tax on the rest. What would be the best way to do this?

Here is some code:

HTML
<tr>
<td colspan=4>
<h3>Printers</h3>
</td>
</tr>

<tr>
<td>
<select name="s1" onChange="which_prt()">
<option value="none" selected></option>
<option value="99.01">Epson Stylus C88 </option>
<option value="38.05">Canon Pixma IP1600</option>
<option value="957.11">EPSON STYLUS PHOTO 2200</option>
</select>
</td>

<td>
<input type="text" name="prt_qty" onChange="totalup_prt()"/>
</td>

<td>
<input type="text" name="prt_price" disabled/>
</td>

<td>
<input type="text" name="prt_total" disabled/>
</td>

</tr>



Javascript
function which_prt()
{
for (i=0;i<document.form1.s1.length;i++)
{
if(document.form1.s1.selected==true)
{
if (document.form1.s1.value=="none")
{
document.form1.prt_qty.value=""
document.form1.prt_price.value=""
document.form1.prt_total.value=""
tmp_prt_qty=0
tmp_prt_price=0
tmp_total_ord=(parseFloat(tmp_total_ord.toFixed(2))-parseFloat(tmp_prt_total.toFixed(2)))
tmp_prt_total=0
total_invoice()
}
else
{
document.form1.prt_qty.value=""
document.form1.prt_price.value=""
document.form1.prt_total.value=""
document.form1.prt_qty.disabled=false
tmp_prt_price=document.form1.s1.value;
document.form1.prt_price.value=("$"+tmp_prt_price)
}
}
}


}

function totalup_prt()
{
document.form1.prt_qty.disabled=true
tmp_prt_qty=document.form1.prt_qty.value
tmp_prt_total=(tmp_prt_price*tmp_prt_qty)
document.form1.prt_total.value=("$"+tmp_prt_total.toFixed(2))
document.form1.prt_total.value=document.form1.prt_total.value
total_invoice()
}








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: Small Java Program Help
•  Some questions about JS.
•  Some questions about JS.
•  Applying discount
•  Re: Hello...
•  Please Help Javascript College Assignment
•  PDF manipulation
•  Re: Submitting Iframes
•  Re: Problems with mkdir


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2007