Results 1 to 4 of 4

Thread: Need help with calculated fields in form

  1. #1
    Join Date
    Apr 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Need help with calculated fields in form

    Here are questions I asked Microsoft

    1.) Is there any way to creat a field in a form that calculates without using
    ASP in FK2K?

    2.) I have a couple of drop downs in a form and was wondering what the
    procedure is to be able to allow the user to choose an oblect from one drop
    down that would then automatically intsert a code number in another field?

    The reply I received is to use Javascript.

    But I have no idea how or even where to begin.

    Can someone help me with this?

    Thanks

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Yes. But you'll have to give us details.
    And what is FK2K?
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Apr 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Yes..FK2K is FrontPage 2000 but only after you have not had any sleep for a long time.

    Here is what I have been playing with http://www.jazzkatamps.com/invoice.htm

    I would like the user to be able to choose a description and have the correct unit price come up then have it multiply by the qty and place that in the line total box. Lastly adding it all up at the bottom

    If the data could then be saved and I could everyso often dump it into a database.

    Thanks and look forward to your help.

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    If the data could then be saved and I could everyso often dump it into a database.
    That's not possible with Javascript. The most that can be done is to submit the values to a server-side script that can handle them.
    Code:
    <form action="dbsave.asp" method="post">
      <fieldset>
        <legend>Ordering Form</legend>
        <select onchange="this.form.elements['tprice'].value = parseInt(this.form.elements['qty'].value) * parseFloat(this.value);">
          <option value="35.99">A bed</option>
          <option value="12.99">A very small chair</option>
        </select>
        <br>
        Quantity: <input type="text" size="1" name="qty">
        <br>
        Total price:
        <input
          type="text"
          size="4"
          name="tprice"
          style="
            background-color: transparent;
            border: 0px none;
          "
          readonly="readonly"
        >
        <input type="submit" value="Save">
      </fieldset>
    </form>
    Note that the values generated by this script can be edited by the user, and so should not be relied on for anything other than to give the user information.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

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