Lightbox not showing contact form

These are the 404 errors I see in the console:

It took a little detective work, but it seems that the first three CSS errors are being caused by this file: http://www.packagingequipment4sale.com/css/zoo.css

I’m not sure why it is reporting the error as being caused by line 35 though.
If you look through the rest of your includes, I’m sure you’ll find the other errors.

As I said, Lightbox2 only supports images. You’ll need to use another Lightbox-type script.
Plus, it is working for me in Chrome, latest:

Did you change something in the meantime?

Yes, I changed the code following a members advice. I was able to get the form to show but it isnt sending the data. I am slowly trying to work this out, but being new to php it is taking a bit of time.

Basically when a visitor requests info on a product, I need the email to be sent that says something like

Someone has requested info on product ABC Bulk Depalletizer

Name - Visitors Name
Email - Email
Phone - 123-456-7890

But I cannot figure out how to get the product info sent, there are 100’s of products and the page url looks like the one I showed above, The item number changes based on the item.

Do you have multiple products on a page or is it one product per page, denoted by the query string as in your example?

No, just one product per page.

But the pages are set up like

product.php?Item-1
product.php?Item-2 and so on

Ok, so taking new-product.php?Item=26 as an example, when I click on “More Information about this product” I see the form in the lightbox.

Within the form, you have marked three fields with an asterisk (name, email and phone). I am assuming that you wish to validate these on the client-side when the form is submitted. Is that correct?

Below the “Request quote” button I see:

ABC Bulk Depalletizer

Manufacturer: 
Model: 
Category: 

What should go here?

If the item has any of that info then it will show up.

I am also trying to figure how to not show them if there is no data for them variables.

I can get the form to send the basic info (name, email, phone) but I cannot get it to also send the Item info. Item name.

I would like the form that is mailed to me to have all the info and also have the item name and the page url the item is on.

I would do this in PHP.
I assume you have all of your product info in the database, so would it be possible to output it to the page if it is present and skip it if it isn’t?

Correct, I do have my page written in php, what I am after now is getting the form to send the product info. It is sending the usual info but not the stuff being pulled from the database.

Do you have an example of as page where this info (e.g. manufacturer, model and category) is present in the form?

Hi,

I just got your PM, but would rather keep the discussion in one place so will reply here :slight_smile:

You said:

Well, you would need to send this info to your PHP script. Currently you have:

var dataString = 'name='+ name + '&email=' + email + '&eid=' + eid + '&Company=' + company + '&Number=' + number; 

can you not just add an unique identifier to the product name:

<div class="element element-itemname first last" id="productName">ABC Bulk Depalletizer</div>

then add the following to the dataString variable:

+ '&url' = document.URL + '&productName' = $("#productName");

Thats the thing, I dont know where to add it in the code being brand new to php.

The code above you add to your JavaScript, then you can pull the variables out of the $_POST on the other end:

$url = $_POST['url'];
$product_name = $_POST['productName'];

For reference to the PHP side of this discussion, please see

I appreciate it. I am posted in the php section to see if there was an easier way to accomplish what I am needing to have done.

I got your PM. Could you please keep the discussion here, as otherwise it is hard to keep track of :smile:

You said:

Sure.

On your page new-product.php?Item=26, change:

<div class="element element-itemname first last">ABC Bulk Depalletizer</div>

to:

<div class="element element-itemname first last" id="productName">ABC Bulk Depalletizer</div>

Then adjust the JavaScript:

<script language="javascript" type="text/javascript">
  $(function() {  
     $(".button").click(function() {  
       var name = $("#Form_Name").val();
       var email = $("#Form_Email").val();
       var eid = $("#Form_ID").val();
       var company = $("#Form_Company").val();
       var number = $("#Form_Number").val();
       var dataString = 'name='+ name + '&email=' + email + '&eid=' + eid + '&Company=' + company + '&Number=' + number + '&url' = document.URL + '&productName' = $("#productName"); 
       $.ajax({  
        type: "POST",  
        url: "AJAX_Quote.php",
        data: dataString,  
        success: function() {  
          tb_remove();
          setTimeout("Thanks()", 450);
        }  
      });   
    });  
  });  
  function Thanks(){
    tb_show('Thank You', '#TB_inline?width=400&height=400&inlineId=TBThanks&modal=false', false);
  }
  jQuery.noConflict(); 
  function clearText(field){
    if (field.defaultValue == field.value) field.value = '';
    else if (field.value == '') field.value = field.defaultValue;
  }
</script>

And in AJAX_Quote.php:

<?php
  $url = $_POST['url'];
  $product_name = $_POST['productName'];

I sure appreciate it. But keep in mind, the line below isnt going to be the same for all products.

Oh ok, well you need to find a way to reference the product name so that you can pass it to your PHP script.

Maybe something like:

<div class="element element-itemname first last"><span id="productName">ABC Bulk Depalletizer</span></div>

Basically just wrap it in a span tag with the appropriate id when you echo it to the page.

Or, seeing as you are passing the url to your PHP script and the url contains a query string with the product id, could you not just use that instead?

Ok, I was able to add everything to the code, but now the form will not send. It does nothing when I click the “request info” button.

Can you confirm that everything works as expected with your original code from post#1.

I had the same problem (it did nothing when I clicked the “request info” button), but I had assumed it was working for you, as you stated the following in your PM:

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.