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 3 of 3
  1. #1
    New Coder
    Join Date
    Jun 2012
    Posts
    41
    Thanks
    14
    Thanked 1 Time in 1 Post

    show the value of (.innerHTML) on the email

    hey people, i have a order form, in which the submitted data goes to an email address. The order form has various sections. Within each section there are various products with its price. When customers select the products within a section, there is a total button within each section which shows the subtotal. The resulting subtotal is shown in (.innerHTML)

    for EXAMPLE:

    Code:
    document.getElementById("resultChicken").innerHTML = resultChicken.toFixed(2);
    (i know the code above is javascript, however the main problem is php related)

    there is also a grandtotal button to show the grandtotal in (.innerHTML)

    is there any way of sending the subtotals and grandtotal to email address with the filled in data?

    would really appreciate it if someone could help

    thank you

  • #2
    New Coder
    Join Date
    May 2012
    Location
    Maui, HI
    Posts
    31
    Thanks
    0
    Thanked 7 Times in 7 Posts
    PHP Code:
    $email_body "<div id='resultChicken'>{$chickenSubtotal}</div>" 

  • #3
    New Coder
    Join Date
    Jun 2012
    Posts
    41
    Thanks
    14
    Thanked 1 Time in 1 Post
    thanx kbduvall, however i will be having SEVERAL of these subtotals (.innerHTML), and when the customer clicks on one or more of those several buttons, it should show the subtotals on the email. is there any way of doing this?

    i managed to do that for the form fields as u can see below:

    PHP Code:
     $message "

     <html> 
      <head><title>Order placed</title></head> 
      <body> 
     <p>Email is from  "
    .$email."</p> 
      <p>"
    ;

    $trimmed array_map('trim'$_POST);
    $cleaned array_map('htmlentities'$trimmed);

    $exclude = array("field_name1""fieldname2");      // the fields you don't need to check

    foreach ($cleaned as $key => $value) {
        if (!
    in_array($key$exclude) && !empty($value)) {
            
    $message .= ucwords(str_replace("_"" "$key)) . ": $value</br>";
        } 

    When a customer fills in the form and select the relevant products, it shows up only the products that are selected or if the fields are filled in


    i wanted a similar thing for the subtotals too where if the customer clicks on a particular subtotal button and clicks submit, then only the subtotal to which the customer clicked on, will show up on the email

    thank you

  • Users who have thanked Razzy for this post:

    Miss.Donna (08-08-2012)


  •  

    Posting Permissions

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