How to open a form action in a popup window?

I have a form that has a submit button and a email button.  The email button calls a javascript fuction that will execute a mailform script.  everything is working fine, but I would like the output window from the mail formscript to open in a popup, but currently is opening in a blank page.
currently hte output from the mail script will open in a _blank window.
Thanks in advance for your help
Here is the html code:
<FORM name="drop_list" action="<?php echo $editFormAction; ?>"" method="POST" >
    <input name="emailForm" type="button" id="emailForm" onClick="sendFormEmail()" value="Email">
    <input name="add_patient" type="submit" id="add_patient" onclick=document.drop_list.action='<?php echo $editFormAction; ?>' value="Add Patient">
Here is my javascript code:
function sendFormEmail() //email form
                    document.drop_list.action = "html_form_send.php";
                    document.drop_list.target = "_blank";
  document.drop_list.submit();            // Submit the page
                    return true;
and here is the html_form_send.php
<?php
if(isset($_POST['patient_email'])) {
    // CHANGE THE TWO LINES BELOW
          $email_to = '[email protected]';
    function died($error) {
        // your error code can go here
        echo "We are very sorry, but there were error(s) found with the form you submitted. ";
        echo "These errors appear below.<br /><br />";
        echo $error."<br /><br />";
        echo "Please go back and fix these errors.<br /><br />";
        die();
//    validation expected data exists
    if(!isset($_POST['patient_name']) ||
                 !isset($_POST['patient_email']) ||
                              !isset($_POST['textBox']) ||
                 !isset($_POST['doc_comment']))
    //    died('We are sorry, but there appears to be a problem with the form you submitted.');      
    $first_name = $_POST['patient_name']; // required
    $email_from = $_POST['patient_email']; // required
          $comments = $_POST['doc_comment']; // required
    $error_message = "";
    $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
  if(!preg_match($email_exp,$email_from)) {
    $error_message .= 'The Patient Email you entered does not appear to be valid.<br />';
    $string_exp = "/^[A-Za-z .'-]+$/";
  if(!preg_match($string_exp,$first_name)) {
    $error_message .= 'The First Name you entered does not appear to be valid.<br />';
  if(strlen($comments) < 2) {
    $error_message .= 'The Comments you entered do not appear to be valid.<br />';
  if(strlen($error_message) > 0) {
    died($error_message);
   function clean_string($string) {
      $bad = array("content-type","bcc:","to:","cc:","href");
      return str_replace($bad,"",$string);
// set subject line
    $email_subject = "referral form for " .$first_name ;
// format message body
          $email_message = '<html><body>';
          $email_message .= '<table border="0">';
          $email_message .= "<tr ><td width='125' style='background: #eee;'><strong>Name:</strong> </td><td>" . strip_tags($_POST['patient_name']) . "</td></tr>";
          $email_message .= "<tr><td><strong>Patient Phone:</strong> </td><td>" . strip_tags($_POST['patient_phone']) . "</td></tr>";
          $email_message .= "<tr><td><strong>Side:</strong> </td><td>" . strip_tags($_POST['bodySideOutput']) . "</td></tr>";
          $email_message .= "<tr><td><strong>Area:</strong> </td><td>" . strip_tags($_POST['bodyPartOutput']) . "</td></tr>";
          $email_message .= "<tr><td><strong>Diagnosis:</strong> </td><td>" . strip_tags($_POST['subbodyPartOutput']) . "</td></tr>";
          $email_message .= "<tr><td><strong>Sub Cat:</strong> </td><td>" . strip_tags($_POST['subCatOutput']) . "</td></tr>";
          $email_message .= "<tr><td><strong>Injury2</strong> </td><td></td></tr>";
          $email_message .= "<tr><td><strong>Side2:</strong> </td><td>" . strip_tags($_POST['I2bodySideOutput']) . "</td></tr>";
          $email_message .= "<tr><td><strong>Area2:</strong> </td><td>" . strip_tags($_POST['I2bodyPartOutput']) . "</td></tr>";
          $email_message .= "<tr><td><strong>Diagnosis2:</strong> </td><td>" . strip_tags($_POST['I2subbodyPartOutput']) . "</td></tr>";
          $email_message .= "<tr><td><strong>Sub Cat2:</strong> </td><td>" . strip_tags($_POST['I2subCatOutput']) . "</td></tr>";
          $email_message .= "<tr><td><strong>Doctor Comment:</strong> </td><td width='125' style='background: #eee;'>" . strip_tags($_POST['doc_comment']) . "</td></tr>";
          $email_message .= "</table>";
   $email_message .= "</body></html>";
// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= 'From: '. $email_to."\r\n";
//$headers .= 'CC: '. $email_to. "\r\n";
//$headers .= 'From: '. $email_from. "\r\n";
//$headers .= 'CC: '. $email_from. ',' . $email_to."\r\n";
//send mail
mail($email_from, $email_subject, $email_message, $headers);
//mail($email_from, $email_subject, $email_message, $headers);
?>
<!-- place your own success html below -->
Email Sent
<?php
die();
?>

Im currently trying to take all the validation out of the mail script and do it in the html page itself. 
Bad choice.   Client-side form validation isn't secure  and it does not work if JavaScript is disabled.  A fair number of people turn off JavaScript or use one of the No-Scripts Add-ons in their browsers for perceived security reasons.
Don't forget, spam bots don't use JavaScript either so they will penetrate your forms without missing a beat. 
Server-side validation is very reliable.  And if your script is built properly, it can stop robot submissions and exploitation of your forms which is very important these days.
Nancy O.

Similar Messages

  • How to open XML form item into the same window?

    Hello All,
    I've developed a xml form, when I click on the  item with KM Navigation Iview It opens in a new window.( _blank ).
    Is there a way to open it in the same window ( _self )?
    Thanks
    Amit Yosha

    Hi Amit,
    at the moment, this is not configurable. See XML form display in same browser window for possible workarounds.
    Hope it helps
    Detlev

  • How can I view form details in a popup window?

    Recently, something called Babylon assist took control of Firefox and I was forced to reset Firefox to get rid of this. As a consequence, I lost the ability to right click on a page and select from a list that allowed me to view form details in a pop-up window. I used this feature frequently in developing database driven applications that have lots of forms. Can anyone please tell me how to restore this lovely feature? I found something that opens a new tab with the form information in a large format that is rather ugly - I really want to get back to the nice little pop-up that displayed the basic form information.

    THANK YOU - your clues led me to the correct add-on. It's called 'Links and Forms' and says that it adds back the links and forms tabs that were in the Page Info window of Firefox 2. I have found it to be very handy in debugging forms that I've created.

  • How to Open multiple form with only one screen painter file

    Hi all ,
    I want to reopen the form without closing the active form ,i want to use same srf file ..
    I have already try it but form already exist error occur .
    pl help me , how to do it ?
    how to open multiple form with same srf file without closing active forms .
    thanks in advance,
    msw

    <?xml version="1.0" encoding="utf-16" ?>
    <Application>
      <forms>
        <action type="add">
          <form appformnumber="-1" FormType="-1" type="0" BorderStyle="0" uid="BOE" title="Bill of Entry" visible="1" default_button="1" pane="0" color="0" left="365" top="62" width="801" height="410" client_width="785" client_height="372" AutoManaged="1" SupportedModes="15" ObjectType="">
            <datasources>
              <dbdatasources>
                <action type="add">            
                </action>
              </dbdatasources>
              <userdatasources>
                <action type="add"/>
              </userdatasources>
            </datasources>
            <Menus>
              <action type="enable">
                <Menu uid="1282"/>
              </action>
              <action type="disable">
                <Menu uid="5890"/>
              </action>
            </Menus>
            <items>
            </items>
            <ChooseFromListCollection>
              <action type="add">
                <ChooseFromList UniqueID="-1" ObjectType="-1" MultiSelection="0" IsSystem="1"/>          
              </action>
            </ChooseFromListCollection>
            <DataBrowser/>
            <Settings Enabled="0" MatrixUID="" EnableRowFormat="1"/>
          </form>
          <form appformnumber="-1" FormType="-1" type="0" BorderStyle="0" uid="BOE1" title="Bill of Entry" visible="1" default_button="1" pane="0" color="0" left="365" top="62" width="801" height="410" client_width="785" client_height="372" AutoManaged="1" SupportedModes="15" ObjectType="">
            <datasources>
              <dbdatasources>
                <action type="add">
                </action>
              </dbdatasources>
              <userdatasources>
                <action type="add"/>
              </userdatasources>
            </datasources>
            <Menus>
              <action type="enable">
                <Menu uid="1282"/>
              </action>
              <action type="disable">
                <Menu uid="5890"/>
              </action>
            </Menus>
            <items>
            </items>
            <ChooseFromListCollection>
              <action type="add">
                <ChooseFromList UniqueID="-1" ObjectType="-1" MultiSelection="0" IsSystem="1"/>
              </action>
            </ChooseFromListCollection>
            <DataBrowser/>
            <Settings Enabled="0" MatrixUID="" EnableRowFormat="1"/>
          </form>
        </action>
      </forms>
    </Application>

  • HOW TO OPEN A FORM developed IN 10Gds REL2

    HI,
    How to open a form developed in 10gdsrelease 2 in 10g release1.
    It gives ros error.
    Thanks in Adv.
    Rup
    Message was edited by:
    Rup
    Message was edited by:
    Rup

    My suggestion would be to try converting the form to XML using <10gHome>\bin\frmf2xml.bat, and altering this XML to look like R1 XML. Simply changing the Module version might do the trick, but probably not.
    To see the difference between 10gR1 and 10gR2 XML formats, take a reasonably complex R1 form and convert it to XML. Next, upgrade that same form to R2 and convert it to XML. Compare the two XML files.
    Applying the knowledge gained from this comparison, modify the XML from your original R2 form. Try converting back to FMB using <10gHome>\bin\frmxml2f.bat Please share your findings with the forum!
    Hope this helps,
    Eric Adamson
    Lansing, Michigan
    PS: It is assumed that you have access to both 10gR1 and R2 installations!

  • How to open a FORM developed in 10gds release2 into 10gds release 1 ????

    How to open a FORM developed in 10gds release2 into 10gds release 1
    Thanks in adv.
    Rup
    Message was edited by:
    Rup

    Please check out the Forms.

  • How to open the forms in Browser.

    Dear all,
    can anyone tell me how to open the forms develop in form 6i in browser like Internet Explorer.
    Muhammad Nadeem

    Hi,
    The following Host built-in takes you to the specified site,
    Host('Netscape http://www.oracle.com');
    Best Regards,
    Deepak Rai
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Rama Ala ([email protected]):
    Hi,
    We can open internet browser by using HOST command in FORMS. How to open specific URL into the browser through FORMS.<HR></BLOCKQUOTE>
    null

  • How to open a form multiple times

    pl tell me how to open a form multiple times

    HI Sagar,
    Before adding the form to SBO
    try to get the existing count of the form
    as shown below
    For int = 0 To objApplication.Forms.Count - 1
                If objApplication.Forms.Item(int).TypeEx = FormType Then FormTypeCount += 1
    Next
    THEN append that with your form type as shown below
    objFormCreationParams.FormType=FormType & "_" & FormTypeCount.ToString
    Then add the form to SBO
    SO every time your form is opened the unique id will like URFORMTYPE_1,URFORMTYPE_2 and so on
    Hope this helps
    regards
    vishnu

  • How to install oracle Forms and Report 10g in windows XP OS

    How to install oracle Forms and Report 10g in windows XP OS. Already installed oracle Database 10g in my notebook.
    It is working good.
    please help me this issue.
    please give the steps..............
    Thanks
    Rajeev

    Hello Frank,
    for development, you need to install Oracle Developer
    Suite 10g. This includes Forms and Reports.this topic interests me too, because I've downloaded Developer Suite and Database (both for 10g) from Oracle website, installed them, but I couldn't connect to a database.
    What should be done for me to create a database link and be able to connect locally, in my personal Desktop computer? (Not to a server)
    Once it was told me here that I should download 10g Database - I did it, and installed it, but it didn't work. Later, some of my job partners said I should install them in a sequence - that is, 1st the Developer, and 2nd the Database. But it has failed too. And I don't know how to configure a database connection.
    Best regards,

  • How to open a playlist in it's own window

    Does Anyone know how to open a playlist in it's own window? At one time in past versions of itunes you used to be able to do this.

    No.  They removed that functionality as an improvement to iTunes in version 11.    I saw one person mentioning making a screen grab of the window and displaying it as an image in Preview while looking at the actual iTunes in another window, but it doesn't quite strike me as being the same...
    http://www.apple.com/feedback/itunesapp.html

  • How to open a form based on the the parameter in another Form

    I created a button in a form (FORM1). By clicking this button, I want to open another form (FORM2) based on the a value of one key field in this form(FORM1). Both forms have the same key field.
    So, I wrote the following codes behind the PL/SQL Button Event Handler of the custom event for the button that I created in FORM1.
    v_inventory_num:=p_session.get_value_as_NUMBER(
    p_block_name => "_master_block",
    p_attribute_name => 'A_INVENTORY_NUM',
    p_index => 1
    if v_inventory_num is not null then
    portal30.wwa_app_module.set_target('/pls/portal30/PORTAL.wwa_app_module.link?p_arg_names=_moduleid&p_arg_values=5958032800&p_arg_names=_show_header&p_arg_values=YES&p_arg_names=A_INVENTORY_NUM&p_arg_values='||v_inventory_num,'CALL');
    end if;
    end;
    I could not open the FORM2 by clicking the button on FORM1.
    However,I can open the FORM2 by click the button by using the following code.
    portal30.wwa_app_module.set_target('/pls/portal30/PORTAL30.wwa_app_module.new_instance?p_moduleid=5958032800','CALL');
    How could I pass the parameter in FORM1 into FORM2 and when the FORM2 is opened if has already been queried with the passed parameter?
    Your help would be highly appreciated!
    Jeffrey Wei Ye

    Hi:
    Thank you for reply to my question.
    I have tried your codes and apply them the following the form. However, I always got the following error:
    Error: (WWV-00000)
    No conversion performed for type INTEGER, value . (WWC-49102)
    No conversion performed for type INTEGER, value . (WWC-49102)
    No conversion performed for type INTEGER, value . (WWC-49102)
    No conversion performed for type INTEGER, value . (WWC-49102)
    My codes is:
    declare
    request_no number;
    blk varchar2(30) := 'DEFAULT';
    l_url varchar2(4000);
    begin
    request_no := p_session.get_value_as_NuMBER(
    p_block_name => blk,
    p_attribute_name => 'A_WORK_REQUEST_ID');
    l_url := 'portal30.wwa_app_module.link?p_arg_names=_moduleid&p_arg_values=11880470335&p_arg_names=_sessionid&p_arg_values=&p_arg_names=work_request_id&p_arg_values='||request_no;
    portal30.wwa_app_module.set_target(l_url,'call');
    end;
    then,
    I created another form which has two fields and the dattype of pk is varchar2 and change manually put the pk's p_arg_value into the url.
    e.g.
    l_url:='PORTAL30.wwa_app_module.link?p_arg_names=_moduleid&p_arg_values=9029417810&p_arg_names=WORK_AREA_CD&p_arg_values=APP';
    portal30.wwa_app_module.set_target(l_url,'call');
    However, I still get the error message as below:
    Error: (WWV-00000)
    No conversion performed for type INTEGER, value . (WWC-49102)
    No conversion performed for type INTEGER, value . (WWC-49102)
    No conversion performed for type INTEGER, value . (WWC-49102)
    No conversion performed for type INTEGER, value . (WWC-49102)
    No conversion performed for type INTEGER, value . (WWC-49102)
    Your help would be highly appreciated.
    Wei Ye

  • How to open multiple form?

    I created a PR form under AP, and it loaded successfully for the first click.
    However, how to code it in C# to be able to pop up another PR form? Just like SAP System form, it popups another form when the menu is clicked.
    Thank you for your kind attention.
    Ken

    Hi
    Your need to change formUID.
    Note: don't use SAP reserved uid's "F_".
    HTH
    Regards
    Sierdna S.
    P.S. An example.
    Public Function SBO_CreateForm_Select( _
           ByRef in_oApp As SAPbouiCOM.Application, _
           ByRef in_oCmp As SAPbobsCOM.Company _
    ) As SAPbouiCOM.Form
      Dim oForm As SAPbouiCOM.Form
      Try
          SBO_Application = in_oApp
          SBO_Company = in_oCmp
          Dim sFormXmlFile As String = "MY_FORM.xml"
          Dim sUniqueID As String = "O99_" & Format(Now.Millisecond, "000") ' where O99 is your parthner ID
          Call ReplaceUIDandLoadToB1(sFormXmlFile, sUniqueID)
          oForm = SBO_Application.Forms.Item(sUniqueID)
          oForm.Visible = True
      Catch ex As Exception
          Dim s As String = ex.Message
          SBO_Log.WriteLog(Me.ToString, "SBO_CreateForm_Select", s)
          SBO_Application.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Long, BoStatusBarMessageType.smt_Error)
          If Not oForm Is Nothing Then
           oForm.Close()
           oForm = Nothing
          End If
          'Me.SBO_FormEventHDL.oPrzSpeForCli = Nothing
      Finally
          System.GC.Collect() 'Release the handle to the table
      End Try
      Return oForm
    End Function
    ' Change Form UID
    Private Sub ReplaceUIDandLoadToB1( _
          ByRef FileName As String, _
          ByVal a_uid As String _
      Const XML_FormUIDPath As String = "Application/forms/action/form/@uid"
      Dim oXmlDoc As Xml.XmlDocument
      Try
          oXmlDoc = New Xml.XmlDocument
          Dim sPath As String = SBO_AppStarupPath
          oXmlDoc.Load(sPath & "\" & FileName)
          oXmlDoc.SelectSingleNode(XML_FormUIDPath).Value = a_uid
          Dim sPercorso As String = System.Environment.GetEnvironmentVariable("TEMP")
          oXmlDoc.Save(sPercorso & "\" & a_uid & ".xml")
          SBO_Application.LoadBatchActions(oXmlDoc.InnerXml)
      Catch ex As Exception
          SBO_Application.MessageBox(ex.Message)
      End Try
    End Sub     ' Change Form UID
    Edited by: Sierdna S on Sep 30, 2008 9:51 AM

  • How to open new form with set value

    I have two forms CLIENT and ORDERS who are connected by "client_id" in a one to many relationship [one client can have many orders]. What code to I put in the button so that that when I click on it from the CLIENT table, it goes to the ORDERS form with just the orders that match that "client_id"? The application is in oracle 9i developer using swing.
    Here's what I have so far, code to open the form without the binding
    //Open Order Form
    FormIcdClientApplicationView frameTarget = new FormOrderApplicationView(getPanelBinding());
    frameTarget.setVisible(true);
    // Close this window
    this.setVisible(false);

    Hello,
    This is the Forms forum. I am sure you will have more chance to get answer in the JDeveloper forum.
    FRancois

  • How to open a form and close another one

    hi,
    I wish to open a form from another, and then close the calling form. In other words, having FORM1 and FORM2, FORM1 should do this:
    OPEN_FORM ('FORM2',ACTIVATE,SESSION);
    EXIT_FORM(NO_COMMIT,NO_VALIDATE);
    but I cant get this to work. As FORM1 is modal, it opens FORM2 but its still open. Changing the order of the two statements only cause FORM1 to be closed. Can I perform the two operations from within FORM1, avoiding to put the EXIT_FORM statement in FORM2?
    thank you

    Hello,
    Use NEW_FORM to replace the calling module.
    Francois

  • How to open a form of an already opened Access project from another application?

    Dear forum members,
    I have this problem: I have multiple modules in both Excel and Outlook that open Access forms. Therefore is use simple codes like these:
    Sub Regelopenen()
    ActiveWorkbook.FollowHyperlink "\\SERVER\Documenten\JBO\" & Environ("computername") & "\Orderstroom.accdb"
    Set oApp = GetObject(, "Access.Application")
        oApp.DoCmd.OpenForm "OrderOverzicht", , , "ID = " & Range("AM" & Selection.Row)
        oApp.Forms![orderoverzicht].Tabs.Value = 2
        oApp.DoCmd.Requery
    End Sub
    Most times the "Orderstroom.accdb" front-end will be running but when it's not I want the code to open it. For that manner I use the FollowHyperlink method (that simply opens the front-end if it's closed and brings it to the foreground) in
    combination with GetObject (that just sets the object).
    Now, this works like a charm, except for when another front-end was opened
    before Orderstroom.accdb! In that case, the code tries to open the wished form in the front-end that was opened first.
    I know that the form would open in the correct front-end when I add the front-end's path to the GetObject method, however this is no solutions because it will
    always open that front-end, even when it is already opened.
    I've searched for hours the past weeks. Unfortunetaly I can't seem to find a work-around for this problem! Can anyone help me, please? :(
    I'm desperately looking forward for you answers!

    Is this so impossible?

Maybe you are looking for

  • Thread Safe Issue with Servlet

    I saw the following statement in one of the J2EE compliant server documentations: "By default, servlets are not thread-safe. The methods in a single servlet instance are usually executed numerous times simultaneously (up to the available memory limit

  • Blu-ray Disc size not changing.

    I followed adobes workflow for final cut to encore cs4 by using compressor to create and MPEG2 Elementary stream Blu-ray file. now when i take the file (20GB) into encore the blu-ray project and my disc info always says 28 GB. I am trying to trim the

  • 3 problems in one .. sort of.

    this problem just came up today. i went to plug in my 1gen nano to update it with new songs, only after a split second the "do not disconnect" screen disappeared and it obviously did not update. i disconnected the ipod and reconnected it, only this t

  • IMac setup for FinalCut Studio

    I planing to buy a second monitor to the station and to fit with Final Cut Studio I have no idea so please give me some advise. the choice is A. a glossy 21.5" monitor B. matt 21.5" monitor C. glossy LCDTV 32" D. matt LCDTV 32" wich one is suit the s

  • RequestDispatcher forwarding to a blank page

    RequestDispatcher is forwarding to a blank page The code is like this but I a always getting a blank page.This is all written in a JSP page but still I can not access the imlicit objects like request and response I need to declare them explicitly.I d