SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru htown's Avatar
    Join Date
    Mar 2005
    Posts
    676
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help with assigning variables

    I know just enough about JavaScript to be dangerous and I am not sure I have even named the Topic correctly but here goes.

    I have a page that is calculating a form Moving Company and once this form is filled out and submitted my client and the visitor get an identical email (HTML FORMAT) that shows this same form filled out but no check boxes. So the few fields that do have check boxes need to indicate that the check boxes have been checked.

    Example of field on web site:


    Example of Field on Email:

    I want to add the word "Plasma" or "No Plasma" to the description.

    So I am using the checkbox for two reasons.
    1. To add a value to the calculations (to get a total for the move)
    2. To tell my client weather or not this person choose the added service.

    I could just put the assigned number on the email and the fact that it is there would tell my client that they want the service but the number represents what he is actually charging the client and he does not want them to see that number. This is why I need to have a string assigned to it at some point.

    On the quotesheet.html page in the JavaScript function calc() I added:
    Code:
    if (plasma30 = 10) p30 = "Plasma";
    else p30 = "No Plasma";
    But that did not work. So am I on the right track and my syntax is bad or am I way off.

    Thanks.
    Houston Brown
    Split Light Designs
    Bringing your ideas to light.

  2. #2
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So you want "plasma" to show up beside the description of the type TV in the email if the checkbox is checked?

    You should do that in the CF code, not the JS code.
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.


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
  •