Pre made form needing to add a total price.

I have a form with 2 field in it that i want to take one field and multiply it by a number and then the other field take it and multiply it by something else and then add them together.  Any thoughts?

Save as calculate.php
<?php
if (array_key_exists('getTotal', $_POST)) {
$space = trim($_POST['Spaces']);
$electricity = trim($_POST['Electricity']);
$spaceTotal = $space * 40;
$electricityTotal = $electricity * 10;
$combinedTotal = $spaceTotal + $electricityTotal;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<style type="text/css">
p {
border: 1px solid #C30;
padding: 15px;
</style>
</head>
<body>
<form id="claculation" method="post" action="calculate.php">
<h4>Number of Spaces <input name="Spaces" type="text" id="Number of Spaces:" size="10" maxlength="2" />at $40.00 each.</h4>
<h4>I will need electricity hook-up for: <input name="Electricity" type="text" id="Electricity:" size="10" maxlength="2" />
at $10.00 per space. (very limited availability)</h4>
<label for="button"></label>
<input type="submit" name="getTotal" id="getTotal" value="Submit" />
</form>
<?php if(isset($combinedTotal)) {
echo "<p>The combined total = "."$"."$combinedTotal</p>";
?>
</body>
</html>

Similar Messages

  • Forms in PowerShell: putting write-progress onto a pre-made form

    Hello all,
    What I'm wanting to do is use the "Write-Progress" cmdlet and put it onto a form that I've made, instead of having a separate dialogue box for it. Is this possible? Here is the (very simple) form:
    [void][system.reflection.assembly]::LoadWithPartialName("System.Drawing")
    [void][System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
    $objForm = New-Object System.Windows.Forms.Form
    $objForm.Text = "Test"
    $objForm.Size = New-Object System.Drawing.Size(700,300)
    $objForm.StartPosition = "CenterScreen"
    $Form = $objForm.ShowDialog()

    What exactly are you trying to do?  Write-Progress creates it's own form in the ISE, or just displays text based progress in the console, it doesn't have output that you can manipulate that I'm aware of.
    If you want to create your own form for displaying progress, you most likely need to use this method:
    http://learn-powershell.net/2012/10/14/powershell-and-wpf-writing-data-to-a-ui-from-a-different-runspace/
    Because launching a form from Powershell otherwise runs in a single thread and as long as you're interacting with the form, the script won't be doing anything but waiting for input from the form.
    I hope this post has helped!

  • Permanent Font Color Within a pre-made form.

    I have made a form in Pages and also imported a form from Windows. There are many different lines and I want to find a way to type in a different color (Blue) when I change lines without having to format it each and every time. Any ideas?

    Hi scomer6
    Welcome to the forum.
    You could make some dummy text:
    *Black text* (return)
    Blue Text (return)
    Format them both once the way you want them.
    Select the text but not the return of each:
    +Menu > Format > Advanced > Define as Placeholder Text+
    I recommend that you create a style for both sets of text so you can universally change them as necessary later.
    Now copy both sets of text placeholders including both returns and paste as many times as you want down the page to make alternate colored text.
    Now when you click on them each line of text (but not the return) will be selected and you just type or +Paste and Match Style+ the text for that line.
    Peter

  • How to add a total at the end of a characteristic column

    Hi All,
    There is a report where sales document number(0doc_number)is displayed in one of the columns,
    now There is a requirement where I need to add a total count of those doc numbers at the end of that column.
    I am not able to find a suitable way to do that.
    I tried exception aggregation for taking a count of doc numbers but that will be another column then while I need the total at the end of the same
    column which already exists.
    Please assist.
    Thanks,
    Dolly

    Hi Suman,
    A part of the report is :
    I need a count as 2 in above example at the bottom of sales document column.
    Dolly

  • I need to add an attachment to a pdf form from the SBA it is OIC_TABS_NGPC_nl.pdf

    I need to add an attachment to a pdf form from the SBA it is OIC_TABS_NGPC_nl.pdf

    Do the people who made the form SAY you can add an attachment? If not, do not consider it. The form will probably be read by a computer, so it will only look in the form fields provided.

  • Need to format a form field to add a "%" after the number

    I am working on a form that will both print for manual fill-in and also electronic fill-in using reader. My issue  is that I need to
    add a "%" symbol after the number input by the user. I can't use the percentage format type because that places a 0.0% in the field
    when no data is entered and I can't have that due to the need to be able to print a blank form for manual fill-in. Is there a simpl
    e way to append the % character after the user input only if data is in fact input and to leave the field empty otherwise?

    I assume you only want the user to input numbers and you've then set the format to number.
    In the textfield properties go to the format tab and set it to custom.
    Enter a custom keystroke script:
    if(!event.willCommit)
    var nChars = event.selEnd - event.selStart;
    var aFull = event.value.split("");
    aFull.splice(event.selStart, nChars, event.change);
    var strFull = aFull.join("");
    event.rc = !isNaN(strFull);
    This will allow user to input numbers only - strings are regarded as user type.
    Go to the validation tab and enter a custom validation script:
    f = event.value;
    if(f) {
        event.value = f + " %";
    If I understood your question correctly, that should do the trick.
    Torben.

  • Need to add a new page 1 to a completed form

    I have a 4 page form that was completed. Now I need to add a new page 1 with information in text fields. When I insert a page it is inserted as the last page. I then move the page in the Hierarchy to the correct position and get 2 blank pages. When I try to delete the first one, I'm told there is no subform so the page cannot be deleted and the command is ended.
    Thanks,
    MDawn

    Hi,
        I think I found the issue with the form..you can confirm..
        For the page/ Subform "GuestSysAccessReq" you selected "Following Previous", for "Place" under Pagination tab. And rest of the Pages/ subforms you selected "Top of Next Page" as a value for "Place". And again at the end for "guidelines" page you selected "Top of Page -> Page1" as a value for "Place".
       I corrected all the pages/ subforms to have the same value for the "Place" field as "Top of Page -> Page1" and then I added a new page and I could able to move the page to be the first page in the heirarchy. It did not add an empty page.. I am attaching the modified frm in the forum for your reference..
       Let me know if you have any issues.
    Thanks
    Srini

  • I am currently using FormsCentral to distribute a form created in Acrobat. I need to add an option to one of the drop down fields but do not want to re-distribute the form due to reporting purposes. How can I do this?

       I am currently using FormsCentral to distribute a form created in Acrobat. I need to add an option to one of the drop down fields but do not want to re-distribute the form due to reporting purposes. How can I do this?

    You can open the form in Acrobat, select "File > Save a Copy", open the copy you just saved (it doesn't happen automatically), edit the dropdown to add the new item, save as a new file, and then Reader-enable the file by selecting: File > Save As Other > Reader Extended PDF > Enable More Tools. The resulting PDF should work with FormsCentral just like the original.

  • In Dreamweaver, I need to add the directory to the File being inserted in the following Insert Code:    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 202, 1, 255, Request.Form("DocLocation")) ' adVarWChar

    I have the following code:
    <%
    If (CStr(Request("MM_insert")) = "form1") Then
      If (Not MM_abortEdit) Then
        ' execute the insert
        Dim MM_editCmd
        Set MM_editCmd = Server.CreateObject ("ADODB.Command")
        MM_editCmd.ActiveConnection = MM_NewFLSSARDB_STRING
        MM_editCmd.CommandText = "INSERT INTO DocumentTable (Title, DocLink, UpdatedBy, UpdateDate, Type, Comments) VALUES (?, ?, ?, ?, ?, ?)"
        MM_editCmd.Prepared = true
        MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 202, 1, 255, Request.Form("DocumentName")) ' adVarWChar
        MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 202, 1, 255, Request.Form("DocLocation")) ' adVarWChar
        MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param3", 202, 1, 255, Request.Form("UpdatedBy")) ' adVarWChar
        MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param4", 135, 1, -1, MM_IIF(Request.Form("UpdatedDate"), Request.Form("UpdatedDate"), null)) ' adDBTimeStamp
        MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param5", 202, 1, 255, Request.Form("Type")) ' adVarWChar
        MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param6", 203, 1, 1073741823, Request.Form("Comments")) ' adLongVarWChar
        MM_editCmd.Execute
        MM_editCmd.ActiveConnection.Close
        ' append the query string to the redirect URL
        Dim MM_editRedirectUrl
        MM_editRedirectUrl = "testFLSSARSuperAdminIndex.asp"
        If (Request.QueryString <> "") Then
          If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then
            MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
          Else
            MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
          End If
        End If
        Response.Redirect(MM_editRedirectUrl)
      End If
    End If
    %>
    For param2 above I need to add the directory "Docs/" to the command so that the file can be found by the User.  How do I do that?

    If all documents are going to the "/Docs" folder, then I wouldn't include it in the inserted data as you can just add it dynamically where needed. If you do want to include it and it's not part of the posted form data, then just concatenate it (&) prior to inserting into the table.

  • I need to be able to give them a total price calculation when they submit the form. even if im not using credit card as my only payment option.

    i have an online menu - many of my customers pay by check, cash and credit card as well - is there not an option to show those options...  and items vary in price, i need to be able to give them a total price calculation when they submit the form.

    a) No, b)Yes. Firstly, the only payment gateway currently supported from FormsCentral is PayPal. If your customers complete the FormsCentral Form and order 6 of item 1 at one dollar each and 3 of item 2 at two dollars each, when they press 'Continue to Checkout' button, they are transferred to the PayPal Gateway - which will show the Total to Pay. That's no help for your folks wanting to pay by check. Think you may need another solution. Acrobat won't link directly to a Payment Gateway either, without you doing a bit of JavaScript etc.

  • I have a filable form and I need to add ranking questions

    I have a filable form and I need to add ranking questions. How do I do this?

    Kernel panics are usually caused by a hardware problem – frequently RAM, a USB device or a Firewire device. What external devices do you have connected? When trying to troubleshoot problems, disconnect all external devices except your monitor, keyboard and mouse. Do you experience the same problems?
    To eliminate RAM being the problem, Look at this link: *Testing RAM* @ http://guides.macrumors.com/Testing_RAM Then download & use Memtest & Ramber.
    Do you have an Apple Hardware Test disc? Running the Apple Hardware Test in Loop Mode is an excellent troubleshooting step for finding intermittent hardware problems. It is especially useful when troubleshooting intermittent kernel panics. If Loop Mode is supported by the version of the Apple Hardware Test you are using, you run the Extended Test in Loop Mode by pressing Control-L before starting the test. Looping On should appear in the right window. Then click the Extended Test button.The test will run continuously until a problem is found. If a problem is found, the test will cease to loop, indicating the problem it found. If the test fails, be sure to write down the exact message associated with the failure.In some cases, RAM problems did not show up until nearly 40 loops, so give it a good run.
    May be a solution on one of these links.
    Mac OS X Kernel Panic FAQ
    Mac OS X Kernel Panic FAQ
    Resolving Kernel Panics
    Avoiding and eliminating Kernel panics
    12-Step Program to Isolate Freezes and/or Kernel Panics
    Cheers, Tom

  • Urgent -Need to Add new values for the LOV field in forms

    HI,
    I am customizing an existing form. In that i need to add some values for the LOV fied which can be used during run time.
    Please Can some one help me in doing this?
    Thanks
    Suresh P

    Go to Navigator and edit the LOV or create a new one.
    hope that helps!

  • Creating Hyperlinks In Pre-Made Drop Down List Form

    Ok, I am new to the whole Acrobat world but there is a pre-made object called "drop down list". When I drag it onto my page I am able to enter the title as well as the items I wish to have appear in the drop down. However, I am unable to simply go to "insert" and select "hyperlink". That option is greyed out. Can someone tell me if there is a simple way to create the hyperlink without writing script and also why I can not simply select the hyperlink option? Any feedback or direction would be much appreciated. Likewise, if there are other programs that would easily allow me to do this I would welcome your comments.
    Thanks!

    You can't insert hyperlinks into a drop down in Acrobat.
    Well, you can, but they will remain as plain text.

  • Need to add line feeds

    I am working on an "invoice" print, and it has to be on a pre-printed form, I need to print the totals at the bottom of the page and need help figuring out how to add specific amount of line feeds. I tried printing chr(13) , chr(10), conbination of both, also tried Environment.NewLine, no luck.
    Using SQLRS2000, developing report with VS2003.
    Anyone's suggestions would be greatly appreciated!.

    Hello,
    Are you trying to use it in an expression?  Can you try to wrap the vbCrLf with some dummy text just so you can see that it's working.  Like this:
    ="Some text on line 1." + vbCrLf + "Next, line number 2."
    The result should be:
    Some text on line 1.
    Next, line number 2.
    Jarret

  • Acrobat 9 Pro: Order Form, need SUM=blank? and not $0.00 (HELP!!!)

    I know this might be an easy question for people with javascript knowledge.... but I can't get this working... please help!
    I need Order Form total field (sum) to default to blank (instead of $0.00).
    *example: Under >calculate I am using "simplified field notation" and (Qty1)*7.95 -- sum appears in "total 1"
         The unit price is $7.95 - The value of Qty1 = total 1 (calculations are working fine)
         Currently all total boxes read as $0.00 --- I need SUM to be blank until a customer selects a quantity
    How can I make the SUM default to blank? and NOT $0.00 - Is it a validation script??? If so, please help with code!!!
    Help is appreciated - Thanks!
    PS - SUM fields can't be set as non-printing, because Shipping Dept./Accounting Dept. needs ability to print and view totals (if amount is selected - otherwise it could be blank).
    *** SUM fields need to be blank for customers who print form and manually enter data & totals...
    I am using a Mac, and Adobe Acrobat 9 Pro

    I appreciate the reply... (it's been many hours without one)
    I tried the validation script, and as you indicated, the only way the total field (with the validation script) appears blank is AFTER the Reset button is clicked. (However I have not checked this in a reader)
    I can't see how I can make it work in that manner. Customer inputs Billing & Delivery Addresses at top, then proceeds to select products. If the reset button has to be pressed, all the data (ie. addresses) are removed.
    If there was a way to apply the reset function automatically at the opening of the pdf doc. then it would achieve the result I need. I wonder if there isn't a way with a check box at the top that customer clicks which would apply the reset function.
    If you (or anyone) has any further tips or help I would appreciate it. This is the last item the client has requested for change.
    PS. In case anyone can think of a print script to use... The sum value, when =0 (no qty) needs to print blank sum fields (not $0.00) BUT if there is a sum value, the amount must print (for Ship/Acct Depts)
    *** I just thought of something... The only time where the sum value needs to be blank is when customer prints and inputs data by hand.... so, would there be a way to add a print button that can also clear the sum values at the same time with the "reset" function and the validation script???

Maybe you are looking for

  • How to Find the Data Type of the Field In a Database Table

    Hi Experts, I'm currently working on a program which needs to find out the data type of the given field in a database table. In addition to accessing DD03L directly, is there any other workaround such as function module to help me achieve this? It wo

  • Database link in forms is different that actual database name

    I am using a database link in Oracle Forms 6i, however, the database link name for the referenced database is not the same as the actual databse service/instance name. It does not work, and I suppose its something to do with the global names feature

  • Adobe Reader Multimedia Shortcuts

    Hello Adobe, I have some pencast pdf files that have the multimedia windows where I can play my pencasts. I want to know what are the keyboard shortcuts for play/pause and play forward/backward

  • Fonts have gone crazy with 08 update

    I purchased iLife 08 and installed the iWeb update (including the 2.0.1 web update), and wanted to update my website; simply add a page and fix a couple of typos. First thing was my eps files that had looked fine and worked as transparent pictures we

  • 50.7kbs Down speed!! Next door 2mbs speed!!

    I was talking to my neigbour today about broadband and I said the speed I was getting is a discrace and its like using a dial up modem, she was shoked and invited me in to see her speed of 2mbs a second as I didnt belive her. We both have lines comin