ship to bill to

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Darren

    #1

    ship to bill to

    I have a form with ship to customer and bill to customer fields. Both of
    these are required fields. I want to put a check box in the form and if the
    check box is checked then the value of the ship to customer is loaded into
    the bill to customer. I need this to happen before the form is submitted.

    The person fills in the ship to customer and if the bill to customer is the
    same then they just check the box and the same value is automatically
    entered. If they are different then he just types the bill to customer in.
    Any help on this would be appreciated. Thanks!

    Darren


  • Thomas 'PointedEars' Lahn

    #2
    Re: ship to bill to

    Darren wrote:[color=blue]
    > I have a form with ship to customer and bill to customer fields. Both of
    > these are required fields. I want to put a check box in the form and if the
    > check box is checked then the value of the ship to customer is loaded into
    > the bill to customer. I need this to happen before the form is submitted.
    > [...][/color]

    RTFM. RTFFAQ.

    <form ...>
    <input type="checkbox" name="shipmentE qualsBill"
    onclick="if (this.checked)
    this.form.eleme nts['shipmentAddres s'].value =
    this.form.eleme nts['billing'].value;">
    <textarea name="shipmentA ddress"></textarea>
    <textarea name="billingAd dress"></textarea>
    </form>

    This won't work if client-side scripting is not present or if it
    is disabled, so also do server-side checks (which is because this
    client-side solution can only be cosmetic).

    Remove the line-break within the attribute values for XHTML documents.


    PointedEars
    --
    Wealth is too precious to be entrusted to the Rich.
    (Anonymous Kalderan Proverb, Circa C.Y. 500; from: "Andromeda" )

    Comment

    • Thomas 'PointedEars' Lahn

      #3
      Re: ship to bill to

      Thomas 'Ingrid' Lahn wrote:[color=blue]
      > <form ...>
      > <input type="checkbox" name="shipmentE qualsBill"
      > onclick="if (this.checked)
      > this.form.eleme nts['shipmentAddres s'].value =
      > this.form.eleme nts['billing'].value;">[/color]
      'billingAddress '
      [color=blue]
      > <textarea name="shipmentA ddress"></textarea>
      > <textarea name="billingAd dress"></textarea>
      > </form>
      > [...][/color]


      PointedEars

      Comment

      • Dr John Stockton

        #4
        Re: ship to bill to

        JRS: In article <40EC7C8C.80309 04@PointedEars. de>, seen in
        news:comp.lang. javascript, Thomas 'PointedEars' Lahn
        <PointedEars@nu rfuerspam.de> posted at Thu, 8 Jul 2004 00:43:24 :[color=blue]
        >Thomas 'Ingrid' Lahn wrote:[/color]

        False attributions are contrary to Usenet etiquette; the cited article
        was not identifiably written by Ingrid.

        --
        © John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 MIME ©
        Web <URL:http://www.uwasa.fi/~ts/http/tsfaq.html> -> Timo Salmi: Usenet Q&A.
        Web <URL:http://www.merlyn.demo n.co.uk/news-use.htm> : about usage of News.
        No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.

        Comment

        Working...