Connecting Tech Pros Worldwide Forums | Help | Site Map

Form submit w/ hidden fields using text only

sams@centric.net
Guest
 
Posts: n/a
#1: Jul 23 '05
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="ProductQuery.cfm" name="LineCode" method="post">
<input type="hidden" name="Year" value="#GetProducts.Year#">
<input type="hidden" name="Make" value="#GetProducts.Make#">
<input type="hidden" name="Model" value="#GetProducts.Model#">
<input type="hidden" name="Model" value="#GetProducts.Model#">
<input name="SubmitVehicle" type="submit" value="Submit">
</form>

Any ideas?

Thanks!


Lee
Guest
 
Posts: n/a
#2: Jul 23 '05

re: Form submit w/ hidden fields using text only


sams@centric.net 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="ProductQuery.cfm" name="LineCode" method="post">
><input type="hidden" name="Year" value="#GetProducts.Year#">
><input type="hidden" name="Make" value="#GetProducts.Make#">
><input type="hidden" name="Model" value="#GetProducts.Model#">
><input type="hidden" name="Model" value="#GetProducts.Model#">
><input name="SubmitVehicle" 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?

sams@centric.net
Guest
 
Posts: n/a
#3: Jul 23 '05

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.

Lee
Guest
 
Posts: n/a
#4: Jul 23 '05

re: Form submit w/ hidden fields using text only


sams@centric.net 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="whyIwontAllowYouToSubmit.html"
onclick="document.forms['LineCode'].submit();return 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.

David Dorward
Guest
 
Posts: n/a
#5: Jul 23 '05

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
sams@centric.net
Guest
 
Posts: n/a
#6: Jul 23 '05

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:white;
width:8em;
border:Thin Dotted White;
">

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

Closed Thread