Results 1 to 5 of 5

Thread: Variables in HTML form - assigning input type

  1. #1
    Join Date
    Oct 2004
    Posts
    27

    Default Variables in HTML form - assigning input type

    Hello again

    We are passing four variables to the form from our database, which are picked up and used in the form like this:

    <td>Location</td>
    <td>
    <%
    String temp__location="";
    temp__location = request.getParameter("location");
    out.println(temp__location);
    %>
    </td>
    These values are appearing on the form page OK, but I don't know how to assign them an input type to pass them to formmail. They need to appear in the email with all the other (user entered) fields.

    Thanks again for your help
    Last edited by tvulucy; 06-Oct-2004 at 08:33 AM. Reason: More logical title!

  2. #2
    Join Date
    Dec 2003
    Posts
    3,980

    Default Re: Variables in HTML form - assigning input type

    Hi,

    That code between the "<%" and "%>" is Java, correct?

    What I suggest is that you do this (I'm not sure of the Java syntax, but you should get the idea):

    Code:
    td>Location</td>
    <td>
    <%
    String temp__location="";
    temp__location = request.getParameter("location");
    out.println(temp__location);
    out.println('<input type="hidden" name="location" value="' + temp_location + '" />');
    %>
    </td>
    That creates a hidden field on the form. That get's passed to FormMail with all the other values on the form.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  3. #3
    Join Date
    Oct 2004
    Posts
    27

    Default Re: Variables in HTML form - assigning input type

    Hi Russell

    I eventually sussed it.

    Catch the variable:
    <%
    String temp_location="";
    temp_location=request.getParameter("location");
    %>
    Then use it in the input type:
    <input type="hidden" name="location" value="<%=temp_location%>">
    No need for println!

    Thanks
    Lucy

  4. #4
    Join Date
    Oct 2004
    Posts
    27

    Default Re: Variables in HTML form - assigning input type

    Hi Russell, hope you had a good weekend.

    I've resurrected this thread as we're having some problems with the variables

    (I know this is a bit cheeky as it's not really part of formmail, so you are welcome to say you aren't able to assist!)

    Sometimes (about 1 in 4 emails) the variables are not being passed to the email and appear as 'null' in the HTML email output. All other manually entered values are carried across fine. Unfortunately I have been unable to replicate the problem from my PC, despite trying different browsers, reloading and bookmarking the page etc.

    Have you come across anything like this before?

    Thanks again
    Lucy

  5. #5
    Join Date
    Dec 2003
    Posts
    3,980

    Default Re: Variables in HTML form - assigning input type

    Hi,

    hope you had a good weekend
    Thanks, but actually, it's just about start.

    For the problem you're describing, I haven't come across it before. But here are some ideas....

    Is it always the same fields/variables? Are these fields towards the end of the form? Thinking: size of data issue. If you're using the POST method, then that should not be a problem.

    Are these hidden fields? If so, then you can view the source of the HTML page and verify that the values are correct and properly formatted.

    In particular, if the ASP or Java that you're using happens to put in a double-quote character, that will break the HTML and screw up the rest of the form data.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Sample HTML Form Using FormMail
    By russellr in forum FormMail
    Replies: 1
    Last Post: 21-Mar-2007, 06:49 AM
  2. Return All Variables To Form Page On Error
    By cornernote in forum FormMail Subscription Support
    Replies: 12
    Last Post: 31-Oct-2004, 09:20 PM
  3. Removing empty variables from eMail reply
    By Prospero in forum FormMail Subscription Support
    Replies: 4
    Last Post: 25-Jul-2004, 07:22 AM
  4. Submitted form output onto HTML page?
    By LKimber in forum FormMail Subscription Support
    Replies: 2
    Last Post: 13-Apr-2004, 10:39 AM
  5. Adding Attachment Variables
    By Bella in forum FormMail Subscription Support
    Replies: 1
    Last Post: 12-Apr-2004, 09:43 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •