How to submit a form with checkboxes in a page flow?

I'm having some trouble with a form that contains several checkboxes, and
how to submit this form within a page flow...
I have a JSP page containing a form with N checkboxes. The value and
checked/unchecked status of each checkbox is generated from parsing an XML
document. Here is the (simplified) code:
<%@ taglib uri="http://java.sun.com/jstl/xml" prefix="x" %>
<netui:form action="doUpdate">
<x:forEach select="...">
<input type="checkbox" name="id"
<x:if ...>checked</x:if> value="<x:out ... />">
</x:forEach>
<netui:anchor formSubmit="true" action="doUpdate">Submit</netui:anchor>
<netui:anchor action="doCancel">Cancel</netui:anchor>
</netui:form>
When this form is submitted, the checkbox values are lost -- the following
code (in the action) produces an empty array:
String[] prefs = this.getRequest().getParameterValues("id");
I looked at the <netui:checkbox> tag, but it does not appear to give me a
way to set the state and value (unless I've missed something).
Can I submit a form without using a form bean? If I do use a form bean, can
I set the state and value from my JSP?
Any suggestions on how to do this (or insights into what I'm doing wrong)
are welcome...
-- Craig

I am new to this, but I think this may solve your problem:
I am not sure if this is what you are looking for, but you can create a LinkedHashMap
with the req key/value pairs in the page-calling action in the pageflow and then
pass that via a getRequest().setAttribute("myCheckboxes",myCheckboxHashMap);
You can then access it in code using the optionsDataSource portion of the netui:checkBoxGroup
- ie
<netui:checkBoxGroup dataSource="{actionForm.thisCheckbox}" optionsDataSource="{request.myCheckboxes}">
Hope this helps!
m
"Craig Coffin" <craig+1268fbec@nfld-dot-com> wrote:
I'm having some trouble with a form that contains several checkboxes,
and
how to submit this form within a page flow...
I have a JSP page containing a form with N checkboxes. The value and
checked/unchecked status of each checkbox is generated from parsing an
XML
document. Here is the (simplified) code:
<%@ taglib uri="http://java.sun.com/jstl/xml" prefix="x" %>
<netui:form action="doUpdate">
<x:forEach select="...">
<input type="checkbox" name="id"
<x:if ...>checked</x:if> value="<x:out ... />">
</x:forEach>
<netui:anchor formSubmit="true" action="doUpdate">Submit</netui:anchor>
<netui:anchor action="doCancel">Cancel</netui:anchor>
</netui:form>
When this form is submitted, the checkbox values are lost -- the following
code (in the action) produces an empty array:
String[] prefs = this.getRequest().getParameterValues("id");
I looked at the <netui:checkbox> tag, but it does not appear to give
me a
way to set the state and value (unless I've missed something).
Can I submit a form without using a form bean? If I do use a form bean,
can
I set the state and value from my JSP?
Any suggestions on how to do this (or insights into what I'm doing wrong)
are welcome...
-- Craig

Similar Messages

  • How to submit two forms once  in one jsp page?

    hello all,
    My jsp page includes two forms: one form's action is a File Upload servlet, which process file uploading; another is a general servlet to collect user inputs, such as user name, age, etc.
    Because the file upload servlet is a legacy component, and it was used in many applications. we could not meger it into our business components.
    the system requires the file upload and information collection are submitted once. so we have to submit two forms in one 'Submit' action, at the same time, the information collection servlet need get the information from file upload servlet, such as the uploaded file's url.
    I have tried two methods, but all failed
    1. Upload form has no a 'Submit' button, when user click the 'submit' button of the information collection form, we use a javascript to submit upload form first, then submit information collection form. Failed at: the second submit dose wait for upload finishing, then the second submit interrupt the upload
    2. the javascript only submit upload form, and set HTML body's onUnload event to another javascript that submit information collection form. this time, the file upload sucess, and information collection form sucess at most time. But fail when user click the 'refresh' or 'back' or any navigator buttons of the browser. these action will trigger the page 'unload' event too, but the submit if invalid!
    Please tell me how to.

    chain the both requests!
    - build one mutlitpart request and send it to a servlet that can handle that multipart request (think of using oreilly MultiPartParser).
    - check the input (all requiered fields and files there)
    - if yes store the user fields and create a socket connection from your servlet to the legacy file upload servlet and post the file this way.
    - like this you have full control over the users input and can make sure the file and the fields are just save if all requiered elements are availble.

  • How to Submit Struts Form with JavaScript ...!!

    Hi All,
    I have a JSP page with java script and form as shown below. When I click the delete button, the javascript alerts the message "Delete method called" and also in next alert I am getting the form object but the form is not getting submitted and its giving javascript error "Object doesnt support this property or method". Any ideas why?
    My java sctipt method
    <script language="JavaScript">          
         function deleteBillingItem() {
                   alert("Delete method called");
              document.billingItemManagerForm.action="deleteBillingItem.do";
              alert("Form Object-->"+document.billingItemManagerForm);
              document.billingItemManagerForm.submit();
    </script>
    My JSP Code is
    Here I have two buttons one is Edit which of type Submit and other is Delete which is of type just button
    <body bgcolor="#ECF9FF">
              <br>
                   <div class="title" style="margin-top:75px;"><bean:message key="billingItem.editBillingItem"/></div>
              </br>
                   <div align="center">
                        <table width="75%" cellspacing="1" width="435px">                         
                             <logic:notPresent name="billingItems">
                                  <tr>
                                       <td width="30%" class="evencell" style="color:black"><b><bean:message key="billingItem.noRecordsFound"/></b></td>
                                  </tr>                              
                             </logic:notPresent>
                             <logic:present name="billingItems">
                                  <tr>
                                       <td width="30%" class="evencell" style="color:black"><b><bean:message key="billingItem.name"/>     </b></td>
                                       <td width="70%" class="evencell" style="color:black"><b><bean:message key="billingItem.description"/></b></td>
                                  </tr>
                                  <logic:iterate id="billingItemManagerForm" name="billingItems">
                                       <html:form action="/editBillingItem">
                                            <tr>
                                                 <td width="30%" class="oddcell">
                                                       <b><bean:write name="billingItemManagerForm" property="name"/></b>
                                                 </td>
                                                 <td width="60%" class="oddcell">
                                                       <b><bean:write name="billingItemManagerForm" property="businessDesc"/></b>
                                                 </td>
                                                 <td width="10%" class="oddcell">
                                                      <html:hidden name="billingItemManagerForm" property="billingItemId"/>
                                                      <html:submit style="cursor:pointer"> <bean:message key="button.edit"/> </html:submit>  
                                                      <html:button property="buttonDelete" style="cursor:pointer" onclick="deleteBillingItem()"><bean:message key='button.delete'/>  </html:button>
                                                 </td>
                                            </tr>
                                       </html:form>
                                  </logic:iterate>
                             </logic:present>
                        </table>
                   </div>
              <font color="red"> <html:errors/> </font>
         </body>
    </html:html>Please help...!!! Thanks

    I am already having a bean for this...but Im bit confused....let me show u the entire code...how im doing...!!!
    In DAO class
       public ArrayList getBillingItemList() {
            log.debug("Entering getBillingItemList...");
            String sql =  null;
              ArrayList billingItemList = null;
              EntityTransaction tx = null;
            try {
                   billingItemList = new ArrayList();
                   em = emfForSettleEntry.createEntityManager();
                   tx = em.getTransaction();
                   tx.begin();
                sql = "select * from BillingItem"; //this table has id, name, description
                   billingItemList = (ArrayList)em.createNativeQuery(sql, BillingItem.class).getResultList(); //here the BillingItem is entity bean
                   tx.commit();
            } catch (RuntimeException e) {
                log.fatal("Fatal Error Occurred - Please contact Administrator:"+ commonUtils.getStackTraceAsString(e));
                return null;
            } catch(Exception e) {
                log.fatal("Fatal Error Occurred - Please contact Administrator:"+ commonUtils.getStackTraceAsString(e));
                   return null;
            } finally {
                em.close();
            log.debug("Exiting getBillingItemList...");
            return billingItemList;
    In my servlet
    if (request.getServletPath().equalsIgnoreCase("/editBillingItem")) {
         billingItemList = billingItemManagerFacade.getBillingItemList(); //facade calls dao method
         if (billingItemList.size() > 0) {
              session.setAttribute("billingItems", billingItemList);
         getServletConfig().getServletContext().
                             getRequestDispatcher("/BillingItemList.jsp").forward(request, response);
    and finally my jsp
    <html:html>
         <head>
              <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
              <title><bean:message key="billingItem.editBillingItem"/></title>
              <link rel="stylesheet" type="text/css" href="css/isoprofilerstyle.css">
              <script type="text/javascript" src="scripts/scrollableTable.js"></script>
              <script language="JavaScript">          
                   function deleteBillingItem() {
                        document.billingItemManagerForm.action="deleteBillingItem.do";
                        alert("Form Object-->"+document.billingItemManagerForm);
                        document.billingItemManagerForm.submit();
              </script>
         </head>
        <body bgcolor="#ECF9FF">
              <br>
                   <div class="title" style="margin-top:75px;"><bean:message key="billingItem.editBillingItem"/></div>
              </br>
                   <div align="center">
                        <table width="75%" cellspacing="1" width="435px">                         
                             <logic:notPresent name="billingItems">
                                  <tr>
                                       <td width="30%" class="evencell" style="color:black"><b><bean:message key="billingItem.noRecordsFound"/></b></td>
                                  </tr>                              
                             </logic:notPresent>
                             <logic:present name="billingItems">
                                  <tr>
                                       <td width="30%" class="evencell" style="color:black"><b><bean:message key="billingItem.name"/>     </b></td>
                                       <td width="70%" class="evencell" style="color:black"><b><bean:message key="billingItem.description"/></b></td>
                                  </tr>
                                  <logic:iterate id="billingItemManagerForm" name="billingItems">
                                       <html:form action="/editBillingItem">
                                            <tr>
                                                 <td width="30%" class="oddcell">
                                                       <b><bean:write name="billingItemManagerForm" property="name"/></b>
                                                 </td>
                                                 <td width="60%" class="oddcell">
                                                       <b><bean:write name="billingItemManagerForm" property="businessDesc"/></b>
                                                 </td>
                                                 <td width="10%" class="oddcell">
                                                      <html:hidden name="billingItemManagerForm" property="billingItemId"/>
                                                      <html:submit style="cursor:pointer"> <bean:message key="button.edit"/> </html:submit>  
                                                      <html:button property="buttonDelete" style="cursor:pointer" onclick="deleteBillingItem()"><bean:message key='button.delete'/>  </html:button>
                                                 </td>
                                            </tr>
                                       </html:form>
                                  </logic:iterate>
                             </logic:present>
                        </table>
                   </div>
              <font color="red"> <html:errors/> </font>
         </body>
    </html:html>
    Please let me know where and what changes I need to make...???

  • Email form with checkboxes

    Hi All,
    I have a form with checkboxes that I finally got to work
    partially. However, there is one problem. If you forget to check
    the checkbox, (Yes or No), you get the error Element is Undefined.
    If you check the checkbox there is no problem and the form goes
    through email. How can I correct the error if the checkboxes are
    not checked. Any help would be appreciated,
    Best,
    Joy

    Joy,
    checkboxes do not pass a value unless they are checked.
    You can do it two ways that I know.
    One way is to set a default so the page does not error:
    <!--- set default so page does not error --->
    <cfparam name="FORM.myCheckbox" default="" type="any">
    The other way is to see if it was checked and do something
    then.
    <!--- If the checkbox is checked do this --->
    <cfif isDefined("FORM.myCheckbox")>
    do something
    <!--- If the checkbox is NOT checked do this --->
    <!--- don't need this cfelse if you don't want to do
    anything --->
    <!--- if it is not checked --->
    <cfelse>
    do something else
    </cfif>
    Ken Ford
    Adobe Community Expert
    Fordwebs, LLC
    http://www.fordwebs.com
    "JRLobdell" <[email protected]> wrote in
    message news:fb6hic$s7a$[email protected]..
    > Hi All,
    > I have a form with checkboxes that I finally got to work
    partially. However,
    > there is one problem. If you forget to check the
    checkbox, (Yes or No), you
    > get the error Element is Undefined. If you check the
    checkbox there is no
    > problem and the form goes through email. How can I
    correct the error if the
    > checkboxes are not checked. Any help would be
    appreciated,
    > Best,
    > Joy
    >

  • How to format a form with adf

    Hi,
    I want to format an adf form like this :
    http://dl.dropbox.com/u/33421977/adf_form.PNG
    To do this I have used af:panelDashboard and af:panelBox with af:panelFormLayout inside.
    Now I don't want to use panelBox anymore, but I don't know how to achieve this without panelDashboard/panelBox.
    What is th best aproach to do this? Can you send me some links which explain how to format a form with adf?
    Thanks.

    Is just a question of style. In the real application this form is included in another panelBox. So it looks too... I don't know how to say it... too heavy?
    In fact I don't want to see these panelBoxe's borders. Maybe I have just to change the style of these boxes? Do you know if it is possible?
    But more generally, what is the right way to format adf forms? Can I achieve this sort of formatting just using panelFormLayout?

  • How to call a form with dabble clicking on a record with one time where

    Hi All,
    How to call a form with dabble clicking on a record with one time where clause. I mean when i dabble click on the current record i want to call another form with details of the
    record with onetime where clause. Can anyone help me in this regard.
    Now i am calling a form with parameter with onetime where but this should avoid.
    Thanks in advance
    Arif

    Hello,
    I mistakenly mark it as solved. There is a problem remain. when i placed the code below it do not execute with the where condition. I mean the condition to execute is not work.
    All records executes. Please correct my code--
    Here the WHEN-BUTTON-PRESSED-trigger on the Edit-Button:
    :GLOBAL.MODE:='EDIT';
    :GLOBAL.REQ_ID:=:PROBLEM_REQUEST.REQ_ID;
    CALL_FORM('REQUEST_ID_PARAM',NO_HIDE,DO_REPLACE,NO_QUERY_ONLY);And also, WHEN-NEW-FORM-INSTANCE-trigger of REQUEST_ID_PARAM:
    DEFAULT_VALUE(NULL, 'GLOBAL.MODE');
    DEFAULT_VALUE(NULL, 'GLOBAL.REQ_ID');
    IF :GLOBAL.MODE='EDIT' THEN
    GO_BLOCK('PROBLEM_REQUEST');
    EXECUTE_QUERY;
    SET_BLOCK_PROPERTY('PROBLEM_REQUEST', INSERT_ALLOWED, PROPERTY_FALSE);
    END IF;Arif

  • How to link a form with MSC2N

    Hi,
    Somebody know how to link a form with MSC2N.
    I want to complete the characteristic in the classification and after I want to print them with MSC2N;
    Thanks a lot for your help.
    Best regards
    Kari

    I explain you my problem.
    I want to link a form with MSC2N in order to print all the characteristic, and  all the informations of the good issue.
    That's why I want to link a form with MSC2N.
    My customer ask me to ceate a form with these informations and I don't kow how to join the characteristics in MSC2N and the datas which come from MIGO.
    Somebody could help me?
    Thanks a lot
    Kari

  • How to design a form with multiple lang(Arabic and Eng) in a page

    Hi All,
    Could you pls help me how to design a form with multiple languages. when I set the form proprties-->Form Locale as Arabic. English text is comming in reverse and when set the FormLocale as English, Arabic text is comming in revese.
    Pls help me how to design
    Thanks in advance.
    Regards,
    Jayakar

    I am not sure how you can have two different languages inside the same PDF.
    Alternatively, if you want to place only the static labels, you can convert all the static label in one language to images and set the form language setting to other. And place the images inside the form using Image field. For example, you can keep the form language as English and then convert all the arabic language labels/ Static text to images.
    Anotherway,
         Have same sections in both the languages and hide and unhide based on the user selection of the language..
         if your user chooses Arabic, then you can unhide the Arabic sections and change the form language properties programmatically..
    Thanks
    Srini

  • How to design a form with multiple lang(Arabic and Eng) in a pge

    Hi All,
    Could you pls help me how to design a form with multiple languages. when I set the form proprties-->Form Locale as Arabic. English text is comming in reverse and when set the FormLocale as English, Arabic text is comming in revese.
    Pls help me how to design
    Thanks in advance.
    Regards,
    Jayakar

    I am not sure how you can have two different languages inside the same PDF.
    Alternatively, if you want to place only the static labels, you can convert all the static label in one language to images and set the form language setting to other. And place the images inside the form using Image field. For example, you can keep the form language as English and then convert all the arabic language labels/ Static text to images.
    Anotherway,
         Have same sections in both the languages and hide and unhide based on the user selection of the language..
         if your user chooses Arabic, then you can unhide the Arabic sections and change the form language properties programmatically..
    Thanks
    Srini

  • 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>

  • I HOW I FILL PDF FORM WITH HEBROW ON CHROME ?

    I HOW I FILL PDF FORM WITH HEBROW ON CHROME ?

    Chrome uses its own (incompatible) PDF viewer.
    Download the PDF to your local disk, then fill it from there with Adobe Reader.  Or use a browser that uses the Adobe PDF plugin.

  • How to populate smart form with new values

    Hi!
    I am new to smart form . Can anybody help me in how to populate smart form with some new fileds. Actually i have to populate credit memo form with some customized values..

    Hello,
    Please elaborate your query more in order to be comprehendable.
    Regards,
    Shehryar

  • How to submit a blob with my form...

    Hi, I get a image blob from database and display it on form.
    However, how can I submit this form including my blob to my action
    page? I tried using a hidden field on my form to hold the blob like
    so:
    <cfset FaceImg = toString(toBinary(FaceImg.BLOB))>
    <cfinput type="hidden" name="FaceImg"
    value="#FaceImg#">
    But for some reason, on the action page, it cannot see it.
    Thanks so much,
    C

    Ok a little more research has turned up this info for IIS.
    POST data is limited to 2 MB on IIS 4.0, and 128 KB on IIS
    5.0. Each
    name/value is limited to 1024 characters, as imposed by the
    SGML spec.
    Of course this does not apply to files uploaded using
    enctype='multipart/form-data'
    See KB #260694 [
    http://support.microsoft.com/default.aspx/kb/260694
    to
    learn how to adjust the limits of POST data (this deals with
    adding/modifying MaxClientRequestBuffer in the registry).
    In IIS 6.0 (Windows Server 2003), you can adjust this setting
    in the
    metabase. You need to increase the setting for
    AspMaxRequestEntityAllowed to allow larger files to be
    handled by the
    Request object. Look for this setting in metabase.xml; the
    default is
    204,800 (200 kb), but you can change it to reflect your
    expected usage.
    You will need to restart IIS for this change to take place,
    unless
    "enable direct metabase edit" is enabled.
    I would suspect there are similar concerns with other web
    servers. And
    as earlier mentioned, browser limits may play into this as
    well.

  • Need help with PHP form with checkboxes, radio buttons and file attachment

    Hi guys,
    I'm having a nightmare with this PHP form where a user can fill it in, attach a doc/pdf and submit. After trying to sort it out with previous code I've used, I've stripped it out and think I should just start again in the hope you geniuses can help!
    Here is the HTML of contact.php:
    <form action="" method="post" name="contact" id="contact">
        <p>Job Title:*<br />
        <input name="position" type="text" /></p>
        <p>Nationality:*<br />
        <select name="nationality">
          <option value="">-- select one --</option>
          <option value="Afghan">Afghan</option>
          <option value="Albanian">Albanian</option>
          <option value="Algerian">Algerian</option>
          <option value="Zambian">Zambian</option>
          <option value="Zimbabwean">Zimbabwean</option>
        </select>
        </p>
        <p>Which country are you currently living in?*<br />
        <select name="country">
        <option value="">-- select one --</option>
        <option value="United Kingdom">United Kingdom</option>
        <option value="Afghanistan">Afghanistan</option>
        <option value="Africa">Africa</option>
        <option value="Zambia">Zambia</option>
        <option value="Zimbabwe">Zimbabwe</option>
        </select>
        </p>
        <label class="radio" for="checkRight">Yes/No question?</label><br />
        <input class="radio" type="radio" name="right" value="Yes" /> Yes
        <input class="radio" type="radio" name="right" value="No" /> No
        <input class="radio" type="radio" name="right" value="N/A" /> Not applicable
        <p>Yes/No question?<br />
        <select name="continue">
        <option value="">-- select one --</option>
        <option value="Yes">Yes</option>
        <option value="No">No</option>
        </select>
        </p>
        <p>Select your resorts:<br />
        Resort 1<input name="res1" type="checkbox" value="Resort 1" />
        Resort 2<input name="res2" type="checkbox" value="Resort 2" />
        Resort 3<input name="res3" type="checkbox" value="Resort 3" />
        Resort 4<input name="res4" type="checkbox" value="Resort 4" />
        Resort 5<input name="res5" type="checkbox" value="Resort 5" />
        Resort 6<input name="res6" type="checkbox" value="Resort 6" />   
        </p>
        <p>Don't send form unless this is checked:* <input type="checkbox" name="parttime" value="Yes" /></p>
        <p>Date of arrival: <input name="arrive" id="datepick" /><br />
        Date of departure: <input name="depart" id="datepick2" /></p>
        <script type="text/javascript" src="assets/scripts/datepickr/datepickr.js"></script>
        <link href="assets/scripts/datepickr/datepickr.css" rel="stylesheet">
        <script type="text/javascript">
        new datepickr('datepick');
        new datepickr('datepick2', {
        </script>
        <p>Name:*<br />
        <input name="name" type="text" /></p>
        <p>E-mail:*<br />
        <input name="email" type="text" /></p>
        <p>Telephone:*<br />
        <input name="telephone" type="text" class="ctextField" /></p>
        <p>Upload CV (Word of PDF formats only):<br />
        <input type="file" name="cv" class="textfield"></p>
        <p><input name="submit" value="Submit Enquiry" class="submitButton" type="submit" /><div style="visibility:hidden; width:1px; height:1px"><input name="url" type="text" size="45" id="url" /></div></p>
    </form>
    By the way, the date boxes work so excuse the Javascript in there!
    To prevent SPAM I've used a trick where there's a hidden URL field which must be left blank for the form to submit which you can see in the PHP.
    Below is where I'm at with the PHP which is placed above the header of contact.php...
    <?php
    if (array_key_exists('submit', $_POST)) {
        $position = $_POST['position'];
        $arrive = $_POST['arrive'];
        $nationality = $_POST['nationality'];
        $parttime = $_POST['parttime'];
        $depart = $_POST['depart'];
        $name = $_POST['name'];
        $email = $_POST['email'];
        $telephone = $_POST['telephone'];
    $to = "[email protected]";
    $subject = "Recruitment Application";
    $message = $headers;
    $message .= "Name: " . $_POST["name"] . "\r\n";
    $message .= "E-mail: " . $_POST["email"] . "\r\n";
    $headers  = "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
    $headers .= "Reply-To: " . $_POST["email"] . "\r\n";
    $headers .= 'From: My Website <[email protected]>' . "\r\n";
    $message= "
    $url = stripslashes($_POST["url"]);
    if (!empty($url)) {
    header( 'Location: http://www.go-away-spam-robots.com' );
    exit();
    if (!isset($warning)) {
    mail($to, $subject, $message, $headers);
    header( 'Location: http://www.mywebsite.co.uk/sent.php' );
    ?>
    I would like to make pretty much all the field compulsory so if a field is left empty (other than the hidden URL field), a warning message is displayed next to that field.
    Also I would like the file upload field to attach to the email that is sent to me and have the results come through to me in a table format.
    Can anyone help me get my form working?
    Thank you and I hope to hear from you!
    SM

    Hi Nancy,
    Great stuff, thank you for the reply.
    I've managed to get the Formm@iler working and running as I need it to.
    The only thing I'm struggling with is when the user clicks submit, they are taken to a page of whatever results the form returned but it is just a white background with Times New Roman text.
    How can I have it so the user is taken to the form results in the websites' page layout?
    I tried sending them to a generic 'thank you' page by adding the following code but it just took them there whatever the results of the form so that's no good...! I have a feeling it's a bit more complicated than that...
    header( 'Location: http://www.nofussbus.co.uk/test/sent.php' );
    Thank you for your help!

  • How to submit a form in a web

    Hi, it's my first post in this forum and it's for asking a very rough problem.
    I want to log in a web which uses a form to authenticate. The page is: https://cv2008.uab.cat. I want that my program in java logs in and retrieves information from it (e.g. downloading a file). I've been studying the form and it uses POST method and requires to fill the username and password fields. Moreover I've found something interesting in the form:
    <input type="hidden" name="lt" value="_c23CA00BA-41D7-8934-6F3E-D754BD70ECBE_kAAFD1C38-B06B-2F6E-776D-92949E17286F" />
                                  <input type="hidden" name="_eventId" value="submit" />
    but I don't know what to do with it.
    Well, about the app, I've been trying to use common httpclient and the.net libs but I couldn't log in.
    Here is my last try:
    import org.apache.commons.httpclient.HttpClient;
    import org.apache.commons.httpclient.NameValuePair;
    import org.apache.commons.httpclient.methods.PostMethod;
    public class HttpClientTutorial {
        public static void main(String[] args){
             HttpClient client = new HttpClient();     
             String response = null;
             PostMethod authPost = new PostMethod("https://sac.uab.cat/login?service=https://cv2008.uab.cat/home/");
             NameValuePair[] data = {
                       new NameValuePair("username", "MY_USER"),
                       new NameValuePair("password", "MY_PASS"),
                       new NameValuePair("lt", "_c23CA00BA-41D7-8934-6F3E-D754BD70ECBE_kAAFD1C38-B06B-2F6E-776D-92949E17286F"), 
                       new NameValuePair("_eventId", "submit"), 
                       new NameValuePair("submit","submit")
             authPost.setRequestBody(data);
             try {
                  client.executeMethod(authPost); 
                  response = authPost.getResponseBodyAsString();
                  System.out.println(authPost.getStatusCode());
             catch(Exception e)
                  System.out.println("Error");
             authPost.releaseConnection();
             System.out.println(response);
    }I'd appreciate any help, thank you!
    Kits

    Hey malcolmmc,
    you were right, that eventId field changes every time I make a client.executemethod(authPost); the problem is that I need to do it to retrieve the value of that field but after I make the authPost.setRequestBody(data); with the information to fill the form, I need to execute the method again and then the value has changed again. So, I need to retrieve the value and "without closing that session" send the form. But I don't know how to do it, I think I'm very close to achieve it 'though!
    My code rightnow is:
    import org.apache.commons.httpclient.HttpClient;
    import org.apache.commons.httpclient.NameValuePair;
    import org.apache.commons.httpclient.methods.PostMethod;
    public class HttpClientTutorial {
         public static String search_lt(String content) {
             String ltValue = "";
             String lt = "lt\" value=\"";
             int i = 0;
             boolean foundIt = false;         
             int max = content.length() - lt.length();
             test:
                 for(i = 0; i <= max; i++) {
                     int n = lt.length();
                     int j = i;
                     int k = 0;
                     while (n-- != 0) {
                         if (content.charAt(j++)
                                 != lt.charAt(k++)) {
                             continue test;
                     foundIt = true;
                          break test;
              if (foundIt == true)
                   i = i + lt.length();                   
                   while (content.charAt(i) != '\"') {
                        ltValue = ltValue + content.charAt(i);
                        i++;
              else
                   System.out.println("Not Found.");
              return ltValue;
        public static void main(String[] args){
             String response, ltValue;
             HttpClient client = new HttpClient();          
             PostMethod authPost = new PostMethod("https://sac.uab.cat/login?service=https://cv2008.uab.cat/sessioCAS/usuari.jsp");
            try {
                 response = authPost.getResponseBodyAsString();
                 ltValue = search_lt(response);
                  NameValuePair[] data = {
                            new NameValuePair("username", "MY_USER"),
                            new NameValuePair("password", "MY_PASS"),
                            new NameValuePair("lt", ltValue), 
                            new NameValuePair("_eventId", "submit"), 
                            new NameValuePair("submit","INICIAR SESSIÓ")
                  authPost.setRequestBody(data);
                  client.executeMethod(authPost); 
                  response = authPost.getResponseBodyAsString();
                  ltValue = search_lt(response);
                  System.out.println(authPost.getStatusCode());
                  authPost.releaseConnection();
                 System.out.println(response);
            catch(Exception e) {
                 System.out.println("Error");
    }{code}
    Thank you for the help!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Maybe you are looking for

  • X3-02 update problem

    - iam not able to udate the firmware the new firmware on my device... my device is running on 5.65 version... the latest version is 5.68 but iam not able to update that....  the software updater shows that the current firmware is the latest firmware.

  • Printing Issuse From Lightroom 4 To Canon Pixma Pro 9000 MK II

    I have been trying to print from Lightroom 4 to a Canon Pixma Pro 9000 MK II.   Whenever I try to print via the front try (for canvas) I get an error message (code 1281) and I cannot print.   I have tried a few different papers as well as canvas and

  • NLS_DATE_FORMAT in DB trigger

    Hi all, I have a problem with NLS_date_format, there exists in database such a trigger CREATE OR REPLACE TRIGGER TR_MZDR1_BRIU BEFORE INSERT OR UPDATE OF col2 ,col3, col4, col5, col6 on MAN_TAB1 FOR EACH ROW begin IF INSERTING THEN select SEQ_id11.ne

  • Calendar invitation via email disappear?

    Calendar invitation received via email just disappear without getting into the calendar? - How can I change so they will stay in the inbox after I answered the invitation? - Can I delete an invitation in the calendar without sending any information b

  • Built specificat​ion won't start

    Hi, I am trying to build a stand-alone application which would start when cFP 2210 Controller is started. In my project I use Build Specification to first build specification. I set it as startup. Then I deploy the specification and some libraries th