Results 1 to 3 of 3
  1. #1
    CoOlbOyCoOl is offline Member
    Join Date
    May 2007
    Rep Power

    Default Simple tax Calcularot help

    Hi All. Very New to the JSTL devlopment tool. I really need help in this simple tax calculator program. Basically, it prompts the user to enter his income. And at the click of the calculate text button, the tax amount pops up at the Your text amount part. I can't seem to get the tax amount to pop up. I have managed to get my form validation to work though. Any help will be greatly appreciated.

    <&#37;@taglib uri="" prefix="c"%>
    <%@taglib uri="" prefix="fmt"%>
    <head><title>Question 4</title>
    <script type="text/javascript">
    function verify() {
    regExp = /\d+\b/;
    if (!(regExp.test(thisForm.income.value))) {
    alert("You must enter valid income amount!");
    return false;}
    return true;

    <fmt:setLocale value="en-US" />
    <c:set var="amount" value="${param.income}" scope = "application"/>

    <c:if test='${empty param.income}'>
    <c:set var="amount" value="0"/>

    <fmt:setLocale value="en-US" />
    <c:set var="tax" value="${}" scope = "application" />

    <b>Enter the amount of total income for this year:</b>
    <form name="thisForm" action="Question4.jsp" method="post"
    onsubmit="return verify();">

    Amount of sales:<input name=income size=10 value=""> <br/><br/>
    <input type=submit value="Calculate Tax">

    // I believe there are errors here. Can't seem to find out where.
    <%-- the following code is to calculate the tax --%>
    <c:when test =" ${param.income} > '1' && ${param.income} < '3000'}"
    > double tax = '0'
    <c:when test=" ${param.income} > '3001' && ${param.income} < '10000'}"
    > double tax = (amount * (105/100))
    <c:when test=" ${param.income} > '10001'}"
    > double tax = (amount * (107/100))


    Your tax amount: <c:out value="tax" />

  2. #2
    lalala123 is offline Member
    Join Date
    Jun 2012
    Rep Power

    Default Re: Simple tax Calcularot help

    Hi! I found your question a interesting one! Did you get the answer to you in the end?
    Do you mind sharing it with me? :) Thanks in advance man!!! :)

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Rep Power

    Default Re: Simple tax Calcularot help

    After 5 years?
    Locking the thread.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. I need a simple programs
    By mikau in forum New To Java
    Replies: 2
    Last Post: 02-11-2008, 03:37 AM
  2. Simple java
    By abhiN in forum New To Java
    Replies: 1
    Last Post: 01-16-2008, 10:13 AM
  3. simple GUI
    By dim_ath in forum New To Java
    Replies: 3
    Last Post: 01-07-2008, 03:00 PM
  4. Probably a really simple question...
    By ibanez270dx in forum New To Java
    Replies: 0
    Last Post: 11-16-2007, 01:27 AM
  5. Seems so simple yet I can't figure it out!
    By adamhaviland in forum New To Java
    Replies: 1
    Last Post: 11-03-2007, 06:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts