Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Sep 2003
    Location
    Saskatoon, Saskatchewan
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Multiple selections/options in a form table

    Hello again

    In my form I have a table that has a checkbox for a class selection;
    A drop list for a start date and end date; and a tuition amount.

    My options:

    If they select a class but not a start date, I want to prompt the user to select one
    from the drop down list.

    If the above is true, I want the tuition to be displayed in the textbox. But only if
    they have the selected a class.

    I want a total for the tuition to be displayed in a text box for all selected classes.

    Tuition amounts are all the same.

    Here is my JavaScript code:

    <script language="JavaScript" type="text/JavaScript">
    <!--
    function checkStartDate () {
    error = "";
    if (document.theform.cs.value == "true" && document.theform.csstart.value == "0")
    { document.write("Please select a start date.") }

    if (error) {
    alert (error);
    return false;
    } else {
    alert ("A confirmation e-mail message will be returned.");
    return true;
    }
    }

    function totalTuition () {
    if (document.theform.cs.value == "true" && document.theform.csstart.value <> "0") { cstuition = "400.00"; }

    //-->
    </script>

    Any help would be appreciated.

    Glen
    cree2me

  • #2
    Regular Coder
    Join Date
    Oct 2003
    Location
    SC
    Posts
    936
    Thanks
    0
    Thanked 0 Times in 0 Posts

    What does this mean <> ?

    if (document.theform.cs.value == "true" && document.theform.csstart.value <> "0")

    what do you think the <> will do and what do u want it to do?

  • #3
    New Coder
    Join Date
    Sep 2003
    Location
    Saskatoon, Saskatchewan
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That's the default if the start date and class are unchecked.

    <> 0, means that a zero will be left in this field.
    cree2me

  • #4
    Master Coder
    Join Date
    Feb 2003
    Location
    Umeå, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    <> is not a JavaScript operator. If you're looking for NOT EQUAL, try != instead.
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards


  •  

    Posting Permissions

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