Form Processor

They have: 2 posts

Joined: Aug 2005

I've created an order form for a client who does large-format digital printing.

This is the form...

The form uses values from the width & height fields to calculate the total square inches of the printed piece. Then, the cost of each option (Resolution, Stock, Mounting, Laminate, & Frame) is added up and multiplied by the total square inches. Finally, this number is multiplied by the quantity to get the total order quote.

The math part all works perfectly. The problem I am having is that on the preview page it displays the form field value for each option. The math uses this value to calculate the price, but I want to show the option name -- not the value -- to the customer. For example, if you complete this form and select the "Adhesive Vinyl" option for the "Stock" field, it will display "Stock 5" on the preview. I need for it to display "Stock Adhesive Vinyl" instead.

This basically means that it should display the option "name" rather than the option "value".

If it helps, I am using Form Processor Pro to build this form. I thought maybe I could use an IF condition to do this, but I cannot get it to work.

Any advice would be greeeatly appreciated.

They have: 222 posts

Joined: Sep 1999

Try this:

<?php
switch($_GET['d_stock'])
{
  case
1:
    echo \
"7mil Matte\";
    break;
  case 2:
    echo \"7mil Gloss\";
    break;
  case 3:
    echo \"Polycarb (clear)\";
    break;
  case 4:
    echo \"Polycarb (white backer)\";
    break;
  case 5:
    echo \"Adhesive Vinyl\";
    break;
}
?>

You may need to put single quotes around the number in the case statement, depending on if it comes in as a number or string, but I think it'll come in as a number.

They have: 2 posts

Joined: Aug 2005

Thanks, but I think we got it figured out.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.