Form submit w/ hidden fields using text only

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • sams@centric.net

    Form submit w/ hidden fields using text only

    I've seen this covered before, but I just don't understand Java very
    well. I apologize if this is a repeat.

    Basically, I need a text/java style submit form with multiple hidden
    fields. It would take the place of the following standard submit
    button:

    <form action="Product Query.cfm" name="LineCode" method="post">
    <input type="hidden" name="Year" value="#GetProd ucts.Year#">
    <input type="hidden" name="Make" value="#GetProd ucts.Make#">
    <input type="hidden" name="Model" value="#GetProd ucts.Model#">
    <input type="hidden" name="Model" value="#GetProd ucts.Model#">
    <input name="SubmitVeh icle" type="submit" value="Submit">
    </form>

    Any ideas?

    Thanks!

  • Lee

    #2
    Re: Form submit w/ hidden fields using text only

    sams@centric.ne t said:[color=blue]
    >
    >I've seen this covered before, but I just don't understand Java very
    >well. I apologize if this is a repeat.
    >
    >Basically, I need a text/java style submit form with multiple hidden
    >fields. It would take the place of the following standard submit
    >button:
    >
    ><form action="Product Query.cfm" name="LineCode" method="post">
    ><input type="hidden" name="Year" value="#GetProd ucts.Year#">
    ><input type="hidden" name="Make" value="#GetProd ucts.Make#">
    ><input type="hidden" name="Model" value="#GetProd ucts.Model#">
    ><input type="hidden" name="Model" value="#GetProd ucts.Model#">
    ><input name="SubmitVeh icle" type="submit" value="Submit">
    ></form>
    >
    >Any ideas?[/color]

    1. Javascript has nothing at all to do with Java.
    2. As far as I know, neither HTML nor either of these languages
    has any feature called a "text/java style submit form".

    What, exactly, do you want?

    Comment

    • sams@centric.net

      #3
      Re: Form submit w/ hidden fields using text only

      Sorry, I didn't explain too well...
      I just need a "text only" submit form. No buttons, just text. It also
      needs to pass some variables over with the hidden fields. If it's
      possible, that would be great. I've seen it done with Javascript, but I
      don't know how to set up the hidden fields.

      Comment

      • Lee

        #4
        Re: Form submit w/ hidden fields using text only

        sams@centric.ne t said:[color=blue]
        >
        >Sorry, I didn't explain too well...
        >I just need a "text only" submit form. No buttons, just text. It also
        >needs to pass some variables over with the hidden fields. If it's
        >possible, that would be great. I've seen it done with Javascript, but I
        >don't know how to set up the hidden fields.[/color]


        What you're asking for is a form that is submitted via an onclick
        event of a link (usually).

        The hidden fields are exactly the same. The only difference is that
        you get rid of the Submit button, and use a link, instead:

        <a href="whyIwontA llowYouToSubmit .html"
        onclick="docume nt.forms['LineCode'].submit();retur n false">Click
        to Submit</a>

        The URL in the HREF attribute is to a page where you explain why
        you have chosen not to allow people without Javascript enabled to
        use this form.

        Comment

        • David Dorward

          #5
          Re: Form submit w/ hidden fields using text only

          Lee wrote:
          [color=blue]
          > What you're asking for is a form that is submitted via an onclick
          > event of a link (usually).[/color]

          That effect is more safely achieved by using a regular submit button and
          some CSS to take away the borders and background colour.

          --
          David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
          Home is where the ~/.bashrc is

          Comment

          • sams@centric.net

            #6
            Re: Form submit w/ hidden fields using text only


            David Dorward wrote:[color=blue]
            > Lee wrote:
            >[color=green]
            > > What you're asking for is a form that is submitted via an onclick
            > > event of a link (usually).[/color]
            >
            > That effect is more safely achieved by using a regular submit button[/color]
            and[color=blue]
            > some CSS to take away the borders and background colour.
            >
            > --
            > David Dorward <http://blog.dorward.me .uk/>[/color]
            <http://dorward.me.uk/>[color=blue]
            > Home is where the ~/.bashrc is[/color]

            David,

            Your suggestion of using CSS worked exactly as I wanted. In case anyone
            is interested, the following "Submit Button" looks like a standard text
            link. I was able to tweek it so it actually looks the same in IE
            Explorer, Netscape and Opera.

            <INPUT TYPE="SUBMIT"
            VALUE="More Products"
            STYLE="
            font-family:Arial;
            font-size:12px;
            color:blue;
            background:whit e;
            width:8em;
            border:Thin Dotted White;
            ">

            You can also add some text decoration, but that produces different
            results in the three browsers I mentioned.

            Comment

            Working...