Multiple form submits php

i have a form with three list/menu items. Each one when selected acts a filter. I would like to submit the form when the user changes the value on each list.menu: I have tried adding an onchange="this.form.submit()" command on each list/menu but only the first one works. I guess the form only recognises one submit item.
Is there a way to get the form to submit on each of the three list/menu items ?
Many thanks,
code ...
<body>
<form id="form1" name="form1" method="post" action="">
  <label>Team
    <select name="myTeam" id="myTeam" onchange="this.form.submit()">
      <?php
do { 
?>
      <option value="<?php echo $row_myTeam['title']?>"<?php if (!(strcmp($row_myTeam['title'], $_POST['myTeam']))) {echo "selected=\"selected\"";} ?>><?php echo $row_myTeam['title']?></option>
      <?php
} while ($row_myTeam = mysql_fetch_assoc($myTeam));
  $rows = mysql_num_rows($myTeam);
  if($rows > 0) {
      mysql_data_seek($myTeam, 0);
  $row_myTeam = mysql_fetch_assoc($myTeam);
?>
    </select>
  </label>
  <label>Qct
    <select name="myQCT" id="myQCT" onchange="this.form.submit()">
      <?php
do { 
?>
      <option value="<?php echo $row_chooseQCT['name']?>"<?php if (!(strcmp($row_chooseQCT['name'], $_POST['myQCT']))) {echo "selected=\"selected\"";} ?>><?php echo $row_chooseQCT['name']?></option>
      <?php
} while ($row_chooseQCT = mysql_fetch_assoc($chooseQCT));
  $rows = mysql_num_rows($chooseQCT);
  if($rows > 0) {
      mysql_data_seek($chooseQCT, 0);
  $row_chooseQCT = mysql_fetch_assoc($chooseQCT);
?>
    </select>
  </label>
  <label>Year
    <select name="myYear" id="myYear" onchange="this.form.submit()">
      <?php
do { 
?>
      <option value="<?php echo $row_myYear['year']?>"<?php if (!(strcmp($row_myYear['year'], $_POST['myYear']))) {echo "selected=\"selected\"";} ?>><?php echo $row_myYear['year']?></option>
      <?php
} while ($row_myYear = mysql_fetch_assoc($myYear));
  $rows = mysql_num_rows($myYear);
  if($rows > 0) {
      mysql_data_seek($myYear, 0);
  $row_myYear = mysql_fetch_assoc($myYear);
?>
    </select>
  </label>
</form>
</body>

#1 Install a Local Testing Server on your machine.
     Win - get Wamp or Xampp
     Mac - get Xampp or Mamp
#2 Move your local site files to the designated folder in your Testing Server.  Either www for Wamp or htdocs if using the others.
#3 In DW, go to Site > Manage Sites and edit your site definition to add a Testing Server.  See screenshots below.
For more details, see Setting up a PHP environment in Dreamweaver
http://www.adobe.com/devnet/dreamweaver/articles/setup_php.html 
Nancy O.

Similar Messages

  • AJAX Multiple Form Submitted with Attachments.

    Hi Everyone and Anyone
    I have an issue with a form when using ajax I cannot get the File Attachment to upload.
    <tr>
    <td><label for="FileAttachment">Attach File (250Mb Limit)</label><br />
    <input type="file" name="FileAttachment" id="FileAttachment" class="cat_textbox" /></td>
    </tr>
    Well that is not exactly true but if I use the standard BC form FormProcessV2 with ajax it is a no files upload.
    But if I put this little bit of code in the form validation ( if (theForm.FileAttachment) theForm.FileAttachment.value = theForm.FileAttachment.value )then the files upload correctly ONLY I get redirect to a page with this:
    {"FormProcessV2Response": { "success": true, "entityId": "28589333", "objectTypeId": "Cases", "objectId": "4686492", "message": "<table class=\"tabledefault\"><tr><td id=\"title\"><strong>Summary of web form submission:<\/strong><br\/><!-- IP Address: 27.252.113.60 --><\/td><\/tr><tr><td id=\"name\"><strong>Your Name<\/strong><br\/>Daniel Telfer<\/td><\/tr><tr><td id=\"email\"><strong>Email Address<\/strong><br\/><a href=\"mailto:[email protected]\">dtug.co.nz<\/a><\/td><\/tr><tr><td id=\"casenumber\"><strong>Case Number<\/strong><br\/>4682<\/td><\/tr><tr><td><strong>Attachment<\/strong><br\/>People .pdf (31.06kb)<\/td> .........Deleted..............<\/tr><\/table><\/td><\/tr><tr><td id=\"innerform_95487\"><table class=\"tabledefault\"><tr><td id=\"CAT_Custom_293_957\"><strong>Upload your CV<\/strong><br \/><\/td><\/tr><\/table><\/td><\/tr><\/table>" }}
    I can also do this and ( if (theForm.FileAttachment) theForm.FileAttachment.value = theForm.CAT_Custom_264793_95487.value; ) which I would like to do but also gives the above error. Even though when I go to the case the file are there.
    I need to do this because the client wants to be able to click on these files and open them and the extend CRM database field just give a part url and the client has issues with this when they want to view the files (having to copy and paste it into the url especially when the url is incorrect as bc alters this in the CRM page without being in edit mode. PLEASE ADD THIS ADOBE! a FILE LINK so it is the same a the case related files.
    I also want to do this because I want all the customer details on the same page and so need to use ajax to submit two forms at the same time which works as long as I do not upload a file, one way works but I get an error and the other the files do not upload and no error. ABODE PLEASE CASES FOR USER DETAILS FORM WOULD BE GREAT ie. name, username, password etc.
    I am trying to keep things as simple as possible for the client and customers. I am so close but so far away.
    1) Does anyone else know if ajax should submit the images automatically or is there some addition code necessary?
    2) Does anyone know why my validation code works but gets an error in ProcessFormV2.aspx (except that it is a hack as I know this)?
    3) Am I going about this completely the wrong and there is a better way.
    Any HELP! would be great? 

    Thanks Liam
    I will have to do this another way.
    It is so close to working it is frustrating. Place this if (theForm.FileAttachment) theForm.FileAttachment.value = theForm.FileAttachment.value  in the form validation and the form fields and files get uploaded you just get redirected to a page with formResponse HTML. But like you say not supported. So another way then.
    BC any chance you can support this, it would be handy.
    Cheers Daniel

  • Preventing user to click on links once form submitted

    Hi All,
    Preventing end user to click on any links once he/she submitted the form until he/she received a response from it.
    I can use filter or shale techniques for this, but it prevents the multiple form submits but not the links.
    (ie, hyperlinks can’t control with the above techniques I suppose.)
    I also used hourglass technique of Javascript. It will show you the hour glass icon once you submitted the form/page.
    Mean while if you mouse over any links on the page (I have other command links on the same page), the hourglass icon showing with hand icon.
    <tr:commandButton provides one attribute blocking=”true”, is not working in this condition.[setting true – blocking user input when the action is initiated and will stop when response received from server.]
    At least if I provide a progress indicator by using <tr:progressIndicator, well enough to the user as some process is going on so that end user can wait for some time.
    I have gone through in detail about it - http://myfaces.apache.org/trinidad/trinidad-api/tagdoc/tr_progressIndicator.html
    Please provide your inputs, how to implement by using <tr:progressIndicator for my <tr:commandButton.
    Or any other fruitful solution for this?
    Thanks in advance :-)

    No idea about the Trinidad component library, but you can also use CSS/JS/DHTML to "freeze" the window during the onsubmit. Add a transparent iframe overlay which covers the whole screen and turn it on during the onsubmit.
    E.g.
    <body>
        <iframe id="freeze" frameborder="0" border="0"></iframe>
        <h:form onsubmit="freeze();">
    iframe#freeze {
        position: absolute;
        visibility: hidden;
        width: 100%;
        height: 100%;
        opacity: 0.0;
        filter: alpha(opacity=0);
    function freeze() {
        document.getElementById('freeze').style.visibility = 'visible';
    }

  • PHP forms submitted as an attachment rather than email?

    How do I get my PHP forms submitted as an attachment rather than email?
    Meaning, if I set up a form on my website and someone completes and submits it, how can I get the responses as an attachment rather than in email text?
    Much appreciated.
    G

    Hi Gunter
    I have spent so much time on this now.
    I have tried to convert the php to an attached .txt or .csv file.
    Learnt a lot but still can not seem to get the form data to be submitted as an attached file.
    Here are two of my attempts, please assist:
    <?php
    $email=$_REQUEST['email'];
    $firstName=$_REQUEST['firstName'];
    $lastName=$_REQUEST['lastName'];
    //The Attachment
    $cr = "\n";
    $data = "Email" . ',' . "First Name" . ',' . "Last Name" . $cr;
    $data .= "$email" . ',' . "$firstName" . ',' . "$lastName" . $cr;
    $fp = fopen('reservationTest.csv','a');
    fwrite($fp,$data);
    fclose($fp);
    // Mail to
    $email = "myemailaddress";
    //subject
    $subject = "Test Budget reservation";
    //Header
    $headers("Content-type: application/octet-stream");
    $headers("Content-Disposition: attachment; filename=reservationTest.csv");
    $headers("Pragma: no-cache");
    $headers("Expires: 0");
    //Message
    $message = "".
    "Email: $email" . "\n" .
    "First Name: $firstName" . "\n" .
    "Last Name: $lastName";
    mail($email, $subject, $message, $headers);
    ?>
    <html>
    <body>
    <table width="400" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td>
    <div align="center">Guperman Your Test Message Has Been Submitted</div>
    </td>
    </tr>
    </table>
    </body>
    </html>
    EOD;
    echo "$theResults";
    OR
    <?php
    /* subject and email variables */
    $email = $_POST['email'];
    $lastname = $_POST['lastname'];
    $firstname = $_POST['firstname'];
        $to = 'myemailaddress';
        $emailSubject = 'Test Form';
        $headers = "From: $email\n";
    $message = "A new reservation test.\n
    Last Name</b>: $lastname
    Name</b>: $firstname
    Email</b>: $email
        mail($to,$emailSubject,$headers,$message);
    //open the file and choose the mode
    $fh = fopen("reservationTest.txt", "a");
    fwrite($fh, $email);
    //close the file
    fclose($fh);
    ?>
    <html>
    <body>
    <table width="400" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td>
    <div align="center">Guperman Your Test Message Has Been Submitted</div>
    </td>
    </tr>
    </table>
    </body>
    </html>
    On both accounts when I test these files I get the following types of messages.
    Warning:  fopen(reservationTest.csv) [function.fopen]: failed to open stream: Permission denied in \\HOSTING\DFS\20\1\9\1\2028751191\user\sites\mywebsite.com\www\reservationTest.php on line 11
    Warning:  fwrite(): supplied argument is not a valid stream resource in \\HOSTING\DFS\20\1\9\1\2028751191\user\sites\mywebsite.com\www\reservationTest.php on line 12
    Warning:  fclose(): supplied argument is not a valid stream resource in \\HOSTING\DFS\20\1\9\1\2028751191\user\sites\mywebsite.com\www\reservationTest.php on line 13
    Fatal error:  Function name must be a string in \\HOSTING\DFS\20\1\9\1\2028751191\user\sites\mywebsite.com\www\reservationTest.php on line 22
    And then to give the .php files permission I left click on the already uploaded files and try and set the permission to 777, but then I get a response like: Setting Access Properties failed for:
    Your assistance is much appreciated. Regards

  • Contact form-checkbox PHP coding doesnt work

    I am a beginner to web page design so i would be grateful if you can explain to me what PHP coding i would need for 'Checkbox' and where to place it in the PHP coding below. I can submit the form to my email with all the headings and the filled in forms with checkbox Yes or No.
    Only problem i have is that part of the check box info appear right at the top of the email message rather than the 'Name', 'Tel', 'Email' etc..Another half of the checkbox appear where it suppose to be wih double heading as shown below. I would also like to remove the <br> from the email message. Can you also tell me how to change the colour for heading so its clear.
    I have marked the checkbox code in BLUE for both HTML and PHP coding below. Sorry for the long coding. Look forward to hearing from someone. Much appreciated.
    Message delivered to the email address as received:
    Rear ground extension: Yes
    Two-storey rear extension: Yes
    Two-storey side extension: No
    Loft: Yes
    New Build: Yes
    Other: Yes
    Name: Test<br>
    Email: [email protected]<br>
    Contact No: 87576as<br>
    Address1: addy1<br>
    Address2: addy2<br>
    Town: town<br>
    County: county<br>
    Postcode: post<br>
    Property Type: Cottage<br>
    Property Area: None<br>
    Message:<br>
    test msg
    My HTML coding for the form:
    <div class="contactForm">
          <form id="form1" name="form1" method="post" action="test2.php">
            <fieldset>
              <legend><strong>Personal Information</strong></legend>
              <table width="690" border="0">
                <tr>
                  <td width="340"><p>
                <label for="name" class="contactLable">Name:</label>
                <input name="name" type="text" id="name" tabindex="10" size="30" />
              </p></td>
                  <td width="340"><p>
                <label for="contact_number" class="contactLable">Contact No:</label>
                <input name="contact_number" type="text" id="contact_number" tabindex="20" size="30" />
              </p></td>
                </tr>
              </table>
              <table width="690" border="0">
                <tr>
                  <td><p>
                <span id="sprytextfield1">
                <label for="email" class="contactLable">Email:</label>
                <input name="email" type="text" id="email" tabindex="30" size="30" />
              <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span> </p></td>
                </tr>
              </table>
            </fieldset>
            <fieldset>
              <legend><strong>Project Information</strong></legend>
              <p><table width="690" border="0">
      <tr>
        <td width="340"><p>
                <label for="address1" class="contactLable">Address 1:</label>
                <input name="address1" type="text" id="address1" tabindex="40" size="30" />
              </p></td>
        <td width="340"> <p>
                <label for="address2" class="contactLable">Address 2:</label>
                <input name="address2" type="text" id="address2" tabindex="50" size="30" />
              </p></td>
      </tr>
      <tr>
        <td><p>
                <label for="town" class="contactLable">Town:</label>
                <input name="town" type="text" id="town" tabindex="60" size="30" />
              </p></td>
        <td><p>
                <label for="county" class="contactLable">County:</label>
                <input name="county" type="text" id="county" tabindex="70" size="30" />
              </p></td>
      </tr>
      <tr>
        <td><p>
                <label for="postcode" class="contactLable">Post Code:</label>
                <input name="postcode" type="text" id="postcode" tabindex="80" size="10" />
              </p></td>
        <td> </td>
      </tr>
      <tr>
        <td><p>
                <label for="propertyType" class="contactLable">Property Type:</label>
                <select name="propertyType" id="propertyType" tabindex="90">
                  <option>Please select</option>
                  <option>Detached</option>
                  <option>Semi-Detached</option>
                  <option>End of Terrace</option>
                  <option>Mid-Terrace</option>
                  <option>Flat</option>
                  <option>Bungalow</option>
                  <option>Cottage</option>
                  <option>Other</option>
                </select>
              </p></td>
        <td><p>
                <label for="propertyArea" class="contactLable">Property Area:</label>
                <select name="propertyArea" id="propertyArea" tabindex="100">
                  <option>Please select</option>
                  <option>None</option>
                  <option>Listed Building</option>
                  <option>Conservation Area</option>
                </select>
              </p></td>
      </tr>
    </table>
    </p>
           </fieldset><fieldset><legend><strong>Project Type</strong></legend>
              <table width="690">
                <tr>
                  <td width="338"><label>
                    <input name="rearExt" type="checkbox" class="contactCheckbox" id="CheckboxGroup1_0" tabindex="110" value="rearExt"/>
                  Rear ground extension</label></td>
                  <td width="340"><input name="sideExt" type="checkbox" class="contactCheckbox" id="CheckboxGroup1_1" tabindex="120" value="sideExt"/>
    Side ground extension</td>
                </tr>
                <tr>
                  <td><input name="twoStoreyRear" type="checkbox" class="contactCheckbox" id="twoStoreyRear" tabindex="130" value="twoStoreyRear"/>
    Two-storey rear extension</td>
                  <td><input name="twoStoreySide" type="checkbox" class="contactCheckbox" id="twoStoreySide" tabindex="140" value="twoStoreySide"/>
    Two-storey side extension</td>
                </tr>
                <tr>
                  <td><input name="loft" type="checkbox" class="contactCheckbox" id="loft" tabindex="150" value="loft"/>
    Loft conversion </td>
                  <td><input name="newBuild" type="checkbox" class="contactCheckbox" id="newBuild" tabindex="160" value="newBuild"/>
    New build </td>
                </tr>
                <tr>
                  <td><input name="flat" type="checkbox" class="contactCheckbox" id="flat" tabindex="170" value="flat"/>
    Flat conversion</td>
                  <td><input name="other" type="checkbox" class="contactCheckbox" id="other" tabindex="180" value="other"/>
    Other conversion</td>
                </tr>
              </table>
            </fieldset>
            <fieldset><legend><strong>Message</strong></legend>
              <p>
                <label for="message" class="contactLable">Your Message or Comments:</label>
                <textarea name="message" id="message" cols="45" rows="5" tabindex="190"></textarea>
              </p>
            </fieldset>
            <br />
            <input type="submit" name="Sumbit" id="Sumbit" value="Submit" tabindex="200" />
          </form>
        </div>
    PHP Coding to send to my email:
    <!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" />
    <META HTTP-EQUIV="refresh" content="0;URL=thankyou.html">
    <title>Email Form</title>
    </head>
    <body>
    <?php
      $name=addslashes($_POST['name']);
      $contact_number=addslashes($_POST['contact_number']);
      $email=addslashes($_POST['email']);
      $address1=addslashes($_POST['address1']);
      $address2=addslashes($_POST['address2']);
      $town=addslashes($_POST['town']);
      $county=addslashes($_POST['county']);
      $postcode=addslashes($_POST['postcode']);
      $propertyType=addslashes($_POST['propertyType']);
      $propertyArea=addslashes($_POST['propertyArea']);
      $rearExt=($_POST['rearExt'])?"Rear ground extension: Yes":"Rear ground extension: No";
      $sideExt=($_POST['sideExt'])?"Side ground extension: Yes":"Side ground extension: No";
      $twoStoreyRear=($_POST['twoStoreyRear'])?"Two-storey rear extension: Yes":"Two-storey rear extension: No";
      $twoStoreySide=($_POST['twoStoreySide'])?"Two-storey side extension: Yes":"Two-storey side extension: No";
      $loft=($_POST['loft'])?"Loft: Yes":"Loft: No";
      $newBuild=($_POST['newBuild'])?"New Build: Yes":"New Build: No";
      $flat=($_POST['flat'])?"Flat: Yes":"Flat: No";
      $other=($_POST['other'])?"Other: Yes":"Other: No";
      $msg.="\n$rearExt\n$wsideExt\n$twoStoreyRear\n$twoStoreySide\n$loft\n$newBuild\n$wflat\n$ other";
      $message=addslashes($_POST['message']);
    // you can specify which email you want your contact form to be emailed to here
      $toemail = "[email protected]";
      $subject = "From Website Test";
      $headers = "MIME-Version: 1.0\n"
                ."From: \"".$name."\" <".$email.">\n"
                ."Content-type: text/html; charset=iso-8859-1\n";
      $body = "Name: ".$name."<br>\n"
                ."Email: ".$email."<br>\n"
                ."Contact No: ".$contact_number."<br>\n"
                ."Address1: ".$address1."<br>\n"
                ."Address2: ".$address2."<br>\n"
                ."Town: ".$town."<br>\n"
                ."County: ".$county."<br>\n"
                ."Postcode: ".$postcode."<br>\n"
                ."Property Type: ".$propertyType."<br>\n"
                ."Property Area: ".$propertyArea."<br>\n"
                ."Rear ground extension: ".$rearExt."<br>\n"
                ."Side ground extension: ".$sideExt."<br>\n"
                ."Two-storey rear extension: ".$twoStoreyRear."<br>\n"
                ."Two-storey side extension: ".$twoStoreySide."<br>\n"
                ."Loft conversion: ".$loft."<br>\n"
                ."New build: ".$newBuild."<br>\n"
                ."Flat: ".$flat."<br>\n"
                ."Other: ".$other."<br>\n"
                ."Message:<br>\n"
                .$message;
      if (!ereg("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$", $email))
        echo "That is not a valid email address.  Please return to the"
               ." previous page and try again.";
        exit;
        mail($toemail, $subject, $body, $msg, $headers);
        echo "Thanks for submitting your comments";
    ?>
    </body>
    </html>

    Dear David
    Thank you so much for the clear explanation. I have been using Lynda.com Dreamweaver CS5 tutorial. I found the coding for checkbox through search and added to the coding from Lynda.com tutorial.
    I made few changes to the coding by removing:
    $msg = "$rearExt<br>\r\n$sideExt<br>\r\n$twoStoreyRear<br>\r\n
              $twoStoreySide<br>\r\n$loft<br>\r\n$newBuild<br>\r\n$flat<br>\r\n$other\r\n";
    as the email message shows the results from the checkbox twice.
    I also removed the <br> from:
    $body = "Name: $name<br>\r\n
              Email: $email<br>\r\n
              Contact No: $contact_number<br>\r\n
             Other: $other\r\n
              Message:\r\n
                $message";
    I have add the result and the PHP coding you have helped to fixed for anyone needing a working PHP code containing Text Fields, Drop Down List, Checkbox and Text Area. Many thanks for all your help. If you have a coding to change the heading text colour I very much appericate it.
    Message sent to email:
              From: Name test <[email protected]>
                 Content-type: text/html; charset=iso-8859-1
    Name: Name test
              Email: [email protected]
                      Contact No: 0123456789
                      Address1: addy1
                      Address2: addy2
                      Town: T
                      County: C
                      Postcode: P/C
                      Property Type: End of Terrace
                      Property Area: Listed Building
                      Rear ground extension: Rear ground extension: No
                     Side ground extension: Side ground extension: No
                     Two-storey rear extension: Two-storey rear extension: Yes
                     Two-storey side extension: Two-storey side extension: No
                     Loft conversion: Loft conversion: No
                     New build: New Build: No
                     Flat: Flat: Yes
                     Other: Other: No
             Message:
               Test message
    PHP coding for customer contact page:
    <!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" />
    <META HTTP-EQUIV="refresh" content="0;URL=thankyou.html">
    <title>Email Form</title>
    </head>
    <body>
    <?php
      $name=$_POST['name'];
      $contact_number=$_POST['contact_number'];
      $email=$_POST['email'];
      $address1=$_POST['address1'];
      $address2=$_POST['address2'];
      $town=$_POST['town'];
      $county=$_POST['county'];
      $postcode=$_POST['postcode'];
      $propertyType=$_POST['propertyType'];
      $propertyArea=$_POST['propertyArea'];
      $rearExt= isset($_POST['rearExt'])?"Rear ground extension: Yes":"Rear ground extension: No";
      $sideExt= isset($_POST['sideExt'])?"Side ground extension: Yes":"Side ground extension: No";
      $twoStoreyRear= isset($_POST['twoStoreyRear'])?"Two-storey rear extension: Yes":"Two-storey rear extension: No";
      $twoStoreySide= isset($_POST['twoStoreySide'])?"Two-storey side extension: Yes":"Two-storey side extension: No";
      $loft= isset($_POST['loft'])?"Loft conversion: Yes":"Loft conversion: No";
      $newBuild= isset($_POST['newBuild'])?"New Build: Yes":"New Build: No";
      $flat= isset($_POST['flat'])?"Flat: Yes":"Flat: No";
      $other= isset($_POST['other'])?"Other: Yes":"Other: No";
      $message=$_POST['message'];
    // you can specify which email you want your contact form to be emailed to here
      $toemail = "[email protected]";
      $subject = "From Website Test";
      $headers = "MIME-Version: 1.0\r\n
                 From: $name <".$email.">\r\n
                 Content-type: text/html; charset=iso-8859-1";
      $body = "Name: $name\r\n
              Email: $email\r\n
              Contact No: $contact_number\r\n
              Address1: $address1\r\n
              Address2: $address2\r\n
              Town: $town\r\n
              County: $county\r\n
              Postcode: $postcode\r\n
              Property Type: $propertyType\r\n
              Property Area: $propertyArea\r\n
              Rear ground extension: $rearExt\r\n
              Side ground extension: $sideExt\r\n
              Two-storey rear extension: $twoStoreyRear\r\n
              Two-storey side extension: $twoStoreySide\r\n
              Loft conversion: $loft\r\n
              New build: $newBuild\r\n
              Flat: $flat\r\n
              Other: $other\r\n
              Message:\r\n
                $message";
      if (!ereg("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$", $email))
        echo "That is not a valid email address.  Please return to the"
               ." previous page and try again.";
        exit;
        mail($toemail, $subject, $body, $headers);
        echo "Thanks for submitting your message";
    ?>
    </body>
    </html>

  • Multiple Forms in a Flash Document and Posting Using ASP

    Hello everyone!
    I have some what of a dilemma on my hands. I am creating
    multiple forms in one document using Flash and need them to post
    using ASP script. I have been researching this for the last six
    days, and I have had NO luck. I have noticed that all the
    information that I have found is for one form, not more than one.
    What I have so far is the Flash document, with 4 forms. The
    basic idea is that a user chooses from a drop down menu (the
    combobox) a location, and depending on the location chosen, it
    takes the user to another frame in the flash document. The forms
    (all their own movie clip) contains a name field, a department
    field, and either a manager name a userID field or an employee
    number as well as the basic buttons for submitting the form or
    resetting the form.
    So far what I have working is the drop down menu (combobox)
    taking me to the proper frame and it shows the appropriate form.
    The reset button clearing the form (deleting any information that I
    have imputed into the input fields), but I have absolutely NO idea
    how to get the submit button to work (I did manage to get it to
    send me a message if there was nothing in one of the input fields),
    and NO idea how to get the information to the ASP file.
    Where there are 4 forms do each of them have to have their
    own ASP file attached to them, or can I use one?
    If anyone knows a site that deals with multiple forms in one
    SWF and posts using ASP that would be greatly appreciated, or if
    you know some actionscript that could be helpful.
    Thank you all in advance.

    That would be part of my problem, I really don't know ASP,
    and I am flying by the seat of my pants.
    The current script I have for the ASP file is:
    <% @Language = "VBScript" %>
    <%
    Option explicit
    Dim strfullName
    Dim strdeptName
    Dim strmanagerName
    Dim strobjeemail
    Dim strlocation
    strfullName.Request.Form("fullName_txt")
    strdeptName.Request.Form("deptName_txt")
    strmanagerName.Request.Form("managerName_txt")
    strlocation.Request.Form("locationName")
    Set strobjemail = CreateObject("CDO.Message")
    strobjemail.From = "[email protected]"
    strobjemail.To = "[email protected]"
    strobjemail.Subject = "Program from " + strlocation
    strobjemail.Body = "This user has completed this progrmam
    from " + strlocation & Chr(13) & Chr(10) & "Name: " +
    strfullName & Chr(13) & Chr(10) & "Department: " +
    strdeptName & Chr(13) & Chr(10) & + "Manager: " +
    strmanagerName
    strobjemail.Send
    Set strobjemail=nothing
    %>
    The AS code that I have so far is:
    function formValidationChecks(){
    if (fullName_txt.length==0){
    status_txt.text = "Please enter your Name";
    else if (deptName_txt.length==0){
    status_txt.text = "Please enter your Department";
    else if (managerName_txt.length==0){
    status_txt.text = "Please enter your Manager";
    else {
    status_txt.text = "Thank You!";
    variables.fullName_txt = fullName_txt.text;
    variables.deptName_txt = deptName_txt.text;
    variables.managerName_txt = managerName_txt.text;
    varLoader.load(varSend);
    trace("-----");
    trace("Name: "+fullName_txt.text);
    trace("Department: "+deptName_txt.text);
    trace("Manager: "+managerName_txt.text);
    trace("Form validated");
    submit_btn.onRelease = function(){
    status_txt.text = "";
    if(formValidationChecks()){
    var lv = new LoadVars();
    lv.fullName_txt = form.fullName_txt.text;
    lv.deptName_txt = form.deptName_txt.text;
    lv.managerName_txt = form.managerName_txt.text;
    lv.sendAndLoad("mail.asp", lv, "POST");
    reset_btn.onRelease = function()
    fullName_txt.text = "";
    deptName_txt.text = "";
    managerName_txt.text = "";
    So far my reset button clears everything, and the submit
    button is tracing the content in the form fields, but it's not even
    grabbing the asp page.
    Any suggestions? Even pages that have tutorials that are in
    the form of a video.
    Thanks

  • Form is not working of multiple form check boxs, source posted. HELP.

    Form is not working of multiple form check boxs, source posted. HELP.
    I'm trying to have golive form be able to check one, two or all of the options in Graphics field.
    As is it will only post results from the last checked box.
    Here's the page
    http://www.perfection-press.com/Pages/ContactForm.html
    Here's where source in golive has scanning,design,filesupplied.
    [code removed to fix forum topic display]

    Since the checkboxes all have the same name, the values are over-writing each other when being passed to the PHP script. The best way to fix that is to add a pair of empty square [] brackets after the checkbox names, so make the names "graphics[]" instead of "graphics". That tells PHP that the values are being passed as a list (an array) instead of a single value. As long as your processing script knows what to do from there (and it does), should solve the problem.
    By the way, I noticed that two of the checkboxes were named "graphics" and the other was "graphic" (singular). You'll want to fix that too so they're all the same.

  • Loading multiple forms in single jsp

    Hi,
    My jsp page has multiple forms (one form for each table which has specific info). So assume it has 3 tables, so 3 forms.
    I need to load all the form when the page is loaded.
    code:
    <FORM name=form1 action="/action1" method=post></FORM>
    <FORM name=form2 action="/action2" method=post></FORM>
    <FORM name=form3 action="/action3" method=post></FORM>
    So if I need to load all the forms, how should I proceed. Also please note each form has its own form class and action class.
    For e.g. Assume Page A (From Page A I am coming to this form page via a hyperlink and there is no action class in between) calls the page with 3 forms and I need to display all the values in the 3 forms. So how can I call the action classes for each of the 3 forms.
    So when and how will the action1, action2, action3 called?
    Any help would be greatly appreciated.
    Thanks.

    Thanks for your reply. I understand only one form would be submitted. Its ok.
    But the thing I am looking at is loading the multiple form values at a time.
    I have page A, Page B (where I need to display multiple form values. Actually this page has 3 tables, and each table is one form e.g. one table has all the name values, one table has all address values. So each has different actions).
    I am calling Page B via a hyperlink from Page A. Since I need to use hyperlink, there is no way (atleast I dont know) of using action class or anything.
    Now, my question is how do I populate the values for all these 3 forms.
    Any help would be great.
    Thanks.

  • Submit multiple forms with java

    Hello,
    I have a problem when I am submitting multiple forms with the javascript document.form1.submit();.
    I shall explain what my problem is. I have made a JSP that contains some forms. In the forms I post values to external sites. so the action from the forms are http://www.example.com/employee/login. I post my username and password to this external link so I have logged in. So I do this for 20 different sites. so 20 different actions in 20 different forms on one JSP.
    Now I have made one button that submit all of this forms. I do this with the javascript document.form1.submit();
    document.form2.submit();
    etc.
    But this is not consistent and I wan't a sollutions in Java so I am sure that all the forms wil execute. Because now he post only some forms and some not. So i want a solid sollution. Can anyone help me.
    Thanks in advance,
    Henk

    I had a similar situation a few years ago, where I needed to close sessions that my application had opened with different servers.
    The way I did it was with a secondary browser window, which my "primary" window would control. I had a JavaScript routine that would set the URL of the secondary window, loop with a timer and check the state of that window until the request had completed, then send the next URL, until I had "fired off" URLs to close all of my sessions.
    If this sounds like something you'd be interested in doing, let me know and I can post the code here.
    James W. Anderson
    The Coca-Cola Company

  • Creating Single/Multiple Form(s) With Spry Tabbed System

    I hope I'm in the right area:
    I would like to know if anyone has any success with create a multiple form or a single form with a Spry tabbed system?
    The project I'm doing requires an ordering system with the use of Spry tabs and I'm not sure if it will work. I'm familiar with creating forms, but unfamiliar with processing it with this kind of system.
    I would appreciate some insight.
    Thank you.

    Okay, I've reviewed the example you gave me and tested it and it worked fine. But when I tried to implement it on my form, the radio button selection didn't post. I'm going to go through this little by little:
    <?php
        if ((isset($_POST['WebPkg']))) {
        echo ($_POST['WebPkg']);                                           
    ?>
    <form id="form1" name="form1" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
    <div id="TabbedPanels1" class="TabbedPanels">
    <ul class="TabbedPanelsTabGroup">
    <li class="TabbedPanelsTab" tabindex="0">Choose A Plan</li>
    <li class="TabbedPanelsTab" tabindex="0">Website Add-Ons</li>
    <li class="TabbedPanelsTab modif" tabindex="0">Premium Upgrades</li>
    <li class="TabbedPanelsTab modif" tabindex="0">Review &amp; Complete</li>
    </ul>
    <div class="TabbedPanelsContentGroup">
    <div class="TabbedPanelsContent">
    <table width="875" border="0" cellpadding="1" cellspacing="1" class="select-plan-table">
      <tr>
        <td class="plans-price"> <span class="price-big"><input value="39.99" title="" class="radio" id="WebsitePkg1" name="WebPkg" type="radio" />$39</span><span class="small-price">.99/mo</span></td>
      <td class="plans-price"><span class="price-big"><input value="79.99" title="" class="radio" id="WebsitePkg5" name="WebPkg" type="radio" />$79</span><span class="small-price">.99/mo</span></td>
        <td class="plans-price"><span class="price-big"><input value="114.99" title="" class="radio" id="WebsitePkg10" name="WebPkg" type="radio" />$114</span><span class="small-price">.99/mo</span></td>
        <td class="plans-price"><span class="price-big"><input value="149.99" title="" class="radio" id="WebsitePkg15" name="WebPkg" type="radio" />$149</span><span class="small-price">.99/mo</span></td>
      </tr>
    </table>
    <div class="additional-pages">
          <p><input class="cf_inputbox" maxlength="150" size="30" title="" id="addpages" name="addpages" type="text" value="0"/></p>
    </div>
    <p><input type="image" src="../images/stories/add-ons.png" width="135" height="33" border="0" style="background: none; border: none; width: 135px; height: 33px; border: none; float: right; cursor: pointer;" onclick="TabbedPanels1.showPanel(1); return false;" name="websiteaddons" alt="Website Add-Ons" ></p>
    </div>
    <div class="TabbedPanelsContent">--second tab--...more parts to the form...</div>
    <div class="TabbedPanelsContent">--third tab--...more parts to the form...
    <input type="image" src="../images/review-and-complete.png" height="33" width="135" style="background: none; border: none; width: 135px; height: 33px; border: none; float: right; cursor: pointer; margin-right: 3px;" onclick="TabbedPanels1.showPanel(3); return false;" name="gotoreview" alt="Review & Complete" />
    </div>
    <div class="TabbedPanelsContent">--fourth tab--
    <p><?php echo((isset($_POST["WebPkg"]))?$_POST["WebPkg"]:"") ?></p>
    <p><input type="checkbox" name="agreement" id="agreement" />Yes, I have completely read, understand, and agree to all articles and policies as outlined in Rewebbed's <a href="#">Terms & Agreement</a>.</p>
    <input name="submit" type="button" value="Account & Billing Info" />
    </div>
    As you can see on Tab 4, I'm expecting  <p><?php echo((isset($_POST["WebPkg"]))?$_POST["WebPkg"]:"") ?></p> to post the sent information with the 'Review & Complete' button clicked in Tab 3. Then in Tab 4, this will be another form that has the posted information to be sent to a payment gateway.
    So why wouldn't it post in the fourth tab?

  • Email form with php

    Hello,
    I have been reading that mailto: is outdated.  I have been reading on creating an email form using php.  I don't  understand.  Do you create a table first to put the info:
    First Name:
    Last Name:
    Email:
    Message:
    Submit button
    Does anyone know of a comprehensive article that I could read with maybe some examples or even tutorial.   This is my webstie www.ewrolexrepair.com.  This is my first website.  I am trying to put somekind of email contact next to my picture.  Any help would be greatly appreciated.  Thanks!

    Below is a ready made php form including First Name, Last Name, Email and Message.
    The form is sent back to the page it is located on i.e. if the form is inserted into a page called 'contact.php' then the action form field would be as follows: <form id="enquiryForm" name="enquiryForm" method="post" action="contact.php">
    Change the below in the code to your email address (the one you want the info to be sent to):
    $to = "[email protected]"; //email address -- change to your own email address
    Change success.php below in the code to the page you want the user to go to after submitting the form.
    header("Location: success.php");
    //Redirect page -- change to your own page
    <!-- FORM CODE STARTS HERE -->
    <?php session_start(); ?>
    <?php
    if (array_key_exists('submit', $_POST)) {
        // check first_name field
    $first_name = trim($_POST['first_name']);
    if (empty($first_name)) {
        $error['first_name'] = 'Please provide your first name';
    elseif ($first_name == 'Please provide your first name') {
        $error['first_name'] = '';
    $_SESSION['first_name'] = $_POST['first_name'];
    // check last_name field
    $last_name = trim($_POST['last_name']);
    if (empty($last_name)) {
        $error['last_name'] = 'Please provide your last name';
    elseif ($last_name == 'Please provide your last name') {
        $error['last_name'] = '';
    $_SESSION['last_name'] = $_POST['last_name'];
    // check email field
    $email = trim($_POST['email']);
    if (empty($email)) {
        $error['email'] = 'Please enter your email address';
    elseif ($email == 'Please enter your email address') {
        $error['email'] = '';
    $_SESSION['email'] = $_POST['email'];
    // check enquiry field
    $message = trim($_POST['message']);
    if (empty($message)) {
        $error['message'] = 'Please enter your message details';
    elseif ($message == 'Please enter your message details') {
        $error['message'] = '';
    $_SESSION['message'] = $_POST['message'];
    if (!empty($_POST['ufo'])) { return false; }
    // recipient
    $to = "[email protected]"; //email address -- change to your own email address
    // email subject
    $subject = "Enquiry from Website";
    // sender
    $sender = "From: ".$_POST['email']."\r\n";
    // build message
    $enquiry = "First Name: $first_name\n\n";
    $enquiry .= "Last Name: $last_name\n\n";
    $enquiry .= "Email Address: $email\n\n";
    $enquiry .= "Message: $message\n\n";
    // send email if no form erorrs
    if (!isset($error)) {
    mail($to, $subject, $enquiry, $sender);
    header("Location: success.php");        //Redirect page -- change to your own page
    ?>
    <!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>PHP Form Test</title>
    <style type="text/css">
    /* style the form input fields */
    #enquiryForm input {
        font-family: arial, verdana, sans-serif;
        font-size: 12px;
        width: 300px;
        padding: 5px;
    /* style the form textarea field */
    #enquiryForm textarea {
        font-family: arial, verdana, sans-serif;
        font-size: 12px;
        width: 300px;
        padding: 5px;
    /* style the form submit button */
    #enquiryForm #submitButton {
        width: 100px;
    </style>
    </head>
    <body>
    <form id="enquiryForm" name="enquiryForm" method="post" action="contact.php">
    <h2>Online Enquiry</h2>
    <p>Required Information*</p>
    <p><label for="Name">First Name* </label><br />
    <input type="text" name="first_name" id="first_name" <?php if(isset($error['first_name'])) echo "style='border: 1px solid #C00; color: #C00;'"; ?> value="<?php if(isset($first_name)) {echo $first_name;} ?><?php if(isset($error['first_name'])) echo $error['first_name']; ?>" onfocus="this.value=''"></p>
      <p><label for="Name">Last Name* </label><br />
      <input type="text" name="last_name" id="last_name" <?php if(isset($error['last_name'])) echo "style='border: 1px solid #C00; color: #C00;'"; ?> value="<?php if(isset($last_name)) {echo $last_name;} ?><?php if(isset($error['last_name'])) echo $error['last_name']; ?>" onfocus="this.value=''"></p>
      <p><label for="email">Email<span>*</span>
    </label><br />
      <input type="text" name="email" id="email" <?php if(isset($error['email'])) echo "style='border: 1px solid #C00; color: #C00;'"; ?> value="<?php if(isset($email)) {echo $email;} ?><?php if(isset($error['email'])) echo $error['email']; ?>" onfocus="this.value=''"></p>
      <p style="padding-bottom: 0;"><label for="enquiry">Message<span>*</span></label><br />
      <textarea name="message" id="message" <?php if(isset($error['message'])) echo "style='border: 1px solid #C00; color: #C00;'"; ?> onfocus="this.value=''"><?php if(isset($message)) {echo $message;} ?><?php if(isset($error['message'])) echo $error['message']; ?></textarea></p>
    <p><input type="text" name="ufo" style="display: none;"></p>
    <p><input type="submit" id="submitButton" name="submit" value="Send Enquiry" /></p>
      </form>
    </body>
    </html>

  • Multiple forms and af:panelPage

    I need several forms inside one af:panelPage component. I want the forms to submit when the Enter key is pressed. The form submission gets very confused when I have nested forms, but if I don't have a form around the af:panelPage, then none of the global buttons are rendered properly.
    I'm using ADF Faces EA11.
    Any suggestions?
    Thanks.

    I know you can't nest forms, but I was trying various things to get the buttons to work. Your suggestion of putting a form around just the global buttons worked - thanks.
    As for why I need multiple forms, it really has to do with wanting the forms to submit when you press enter and with validation control. It seems that most browsers will properly do this when the form has a single entry box on it.
    On my page, I have a display of items (in a table) and above the table I have two areas for quick access to "items." There is a field to enter an item Id with a "show item" button and a field to enter search text and "quick search" button. Since the user already has their hands on the keyboard to enter the ID or search text, I wanted to enable the form submit when they press enter.
    The fields need to be on separate forms so the field validations aren't performed improperly. For example, each field (ID and search text) is marked as required. However, the field is only required for its specific function. Thus, if the user enters some search text and presses Search, I don't want them to see an error message saying that the "item ID is required." since it's only required for the "show item" function.
    As long as the new "subform" feature properly supports validation only on elements of the subform that was submitted, it might do the job.
    Thanks for the quick response on this.

  • How to send Parameters FORM to PHP WEB Page with method POST (secure)?

    Hello everyone,
    i hope someone can help me to find a solution to this problem!
    i have to send "+precious+" parameters from an oracle form to php page, like username and password, with a secure method... i tried with WEB.SHOW_DOCUMENT procedure but it uses GET Method and when the web page open up you can read those parameters in the url...no good!
    some suggestion?
    Thank a lot in advance... FMicio

    The other way you have is to make a PJC java bean ...
    which uses HTTPClient library..
    for example:
    PostMethod post = new PostMethod("http://jakarata.apache.org/");
            NameValuePair[] data = {
              new NameValuePair("user", "joe"),
              new NameValuePair("password", "bloggs")
            post.setRequestBody(data);
            // execute method and handle any error responses.
            InputStream in = post.getResponseBodyAsStream();
            // handle response.I have done a multipart form data post to upload files to my db over httpClient.. and other things...
    Or with java.net.* api-s
    try {
        // Construct data
        String data = URLEncoder.encode("key1", "UTF-8") + "=" + URLEncoder.encode("value1", "UTF-8");
        data += "&" + URLEncoder.encode("key2", "UTF-8") + "=" + URLEncoder.encode("value2", "UTF-8");
        // Send data
        URL url = new URL("http://hostname:80/cgi");
        URLConnection conn = url.openConnection();
        conn.setDoOutput(true);
        OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
        wr.write(data);
        wr.flush();
        // Get the response
        BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
        String line;
        while ((line = rd.readLine()) != null) {
            // Process line...
        wr.close();
        rd.close();
    } catch (Exception e) {
    }Or you can call your web page (post data) from your database
    http://awads.net/wp/2005/11/30/http-post-from-inside-oracle/
    Edited by: Peterv6i on Mar 30, 2012 3:49 PM
    Edited by: Peterv6i on Mar 30, 2012 3:55 PM

  • RetrorespectiveActivation of Multiple Form 16 in mid- of the financial year

    Hi All,
    We have mainatined TAN as per the company Code in feature 40ECC. Now we want to have multiple Form 16 if there is change in company Code of an employee for the financial year 2009.
    We have not activated Multiple Form 16 Switch so far. Now in the last month of financial Year 2009 that in March'2010 (period 12/2009) we want to activate Multiple Form 16 switch from 01.04.2009. After activation Multiple form 16 Switch, we are planning to trigger retro for all employees from 01.04.2009.
    But we are not very much sure what will be the impact of activating Multiple Form 16 switch now in the last period of the financial year.
    Required your valuable inputs on this.
    Thanks,
    Ravinder

    Hi,
    Check whether multiple Form 16 switch is active or not.
    In case this is active, then the Form 16 will be generated as under:
    Company A - showing earnings from 01.04.08 to 31.12.08 only
    Company B - showing earnings from 01.01.09 to 31.03.09 as current earnings and from 01.04.08 to 31.12.08 as income from previous employment.
    In case multiple Form 16 is not active, then the Form 16 that you are getting is correct. However, in this case you need not print the Form 16 of company A. Only the Form 16 from the company code where the employee belongs to as on 31.03.2009 (i.e. last day of the FY) will be printed. And in this case the Form 16 will include complete earnings from 01.04.2008 to 31.03.2009 as current earnings.
    Hope this clarifies your query.
    VK

  • How top open multiple forms at the same time in HRMS menu

    Hi,
    When enabling "Close Other forms" in HRMS menu by excluding the function ‘Navigator: Disable Multiform’ Function in the Responsibility Definition (System Administrator -> Security -> Responsibility -> Define), mutliple forms works fine but I'am facing another error.
    My problem is: when this option is enabled, I tried to run Payroll run request but it turned out that payroll list of values is returning empty values and I'am unable to select any payroll from list of values. the only way to do so is to remove back ‘Navigator: Disable Multiform’ Function from exclusion section in responsibility.
    My requirment is: to have multiple form and payroll run list of values working at the same time
    Thanks

    Reason for this , if ur request is attached to more than 1 responsibility , i think this issue will come , we got same issue
    we remove it from responsibility list , then it is working fine

Maybe you are looking for

  • How can I create a Virtual Private Nework on my MacBook Pro?

    Hello all, I have a MacBook Pro 17" with OS X 10.4.7. I need to install and run five instances of Apache2 and demonstration the websites without having to be connected to a network/Internet. My /etc/hosts file would look something like: 192.168.21.1

  • I am unable to sign Adobe Reader 9 signature fields.

    Hi, I received a PDF  that I need to sign digitally. However, when I try to sign the signature field, nothing happens. Specifically, when I click the field with my mouse, nothing happens. In more detail: 1. I move my mouse over the field, and a dialo

  • Version conversion

    I need to convert my app from LabView version 7.1 to (compatability with) 6.0. I'm aware that 7.1 can save down to 7.0, but have yet to find a reliable means of getting down to 6.0. thanks in advance.

  • Large compound clip crashes project at every start

    hey guys, i've been working on a 90min project on my mountain lion mbp late 2011 (fcpx 10.0.5) but since a few days ago, it crashes as soon as a try to open the project. reading from some posts here, one of my last actions before the first crash (mak

  • Airport Extreme 80211 B/G

    I have a 80211 b/g Airport Extreme. Im I able to hook up a USB HD to this model? Or will this work for only the new models with the 802.11 b/g/n? Thanks