Hi Again,
> Add an Action="/cgi-bin/clientlist.pl" to the form tag
> and just use document.myform.submit() in the script.
> Don't forget to close the form tag with </form>.
>
> <form method="POST" name="myform" action="/cgi-bin/clientlist.pl">
> <stuff..............>
> </form>
Well, it turns out that I will need more than one "action", and will need to
add more as the navigation button list gets longer, so my modified, and
functioning, script ended up being:
<script language="JavaScript">
<!--
function gowhere(num){
if (num == 1){
document.myform.action = "/cgi-bin/script_a.pl";
document.myform.source.value="pwapprove";
}
if (num == 2){
document.myform.action = "/cgi-bin/script_a.pl";
document.myform.source.value="disabled";
}
if (num == 3){
document.myform.action = "/cgi-bin/script_b.pl";
document.myform.source.value="new";
}
document.myform.submit();
}
//-->
</script>
Notice that the action for "3" is different than the others. Using this
method I can add buttons ad-infinitum, all calling different scripts. Thus
we have created a work-around for avoiding the nasty <form> spaces (by using
one form, instead of one for each button) and all my images are right up
against each other, where they belong. This script would work for images in
table cells that need to call different scripts, but need to stay all butted
up against each other.
the other html stayed the same, with the exception of the action=""
<form name="myform" method="post" action="">
<input type="hidden" name="uid" value="$uid">
<input type="hidden" name="first_name" value="$first_name">
<input type="hidden" name="source" value="">
The $ variables are filled with perl, but could also be hard-coded.
The image buttons stayed the same:
<input type="image" name="i1" onclick="gowhere(1)"
src="/test/images/image_a.gif" width=139 height=22 alt=""
border="0"><br>
<input type="image" name="i2" onclick="gowhere(2)"
src="/test/images/image_b.gif" width=139 height=20 alt=""
border="0"><br>
<input type="image" name="i3" onclick="gowhere(3)"
src="/test/images/image_c.gif" width=139 height=20 alt=""
border="0">
and the form was closed:
</form>
Thanks for your ideas. I've gotta start digging into javascript more, the
way object properties are set is very much like the Visual Basic that I
worked in quite a bit back in 92! Speaking of VB, I just got a copy of the
latest version and maybe I'll hammer out a few of those utilities that I was
pining for recently. First on my agenda: a little app that gets a list of
all the alt tags in the html files in a directory, lets me fill them in or
change them and automagically puts them back where they belong. Will let the
list know when/if it gets done.
Jack
>
> Rythmist
>
> -----Original Message-----
> Date: Thursday, May 14, 1998 10:09 PM
> Subject: RE: WC:>: Form spaces in html layout
>
>
> >Hi,
> >
> >Thanks for helping, but I'm baffled by something right now, maybe you can
> >shed some more light? See the bottom of this email:
> >
> >
> >OK, here's what I tried, but when you click on an image it loads the same
> >page that it is called from, rather than going to the right perl script:
> >
> ><script language="JavaScript">
> ><!--
> >function gowhere(num){
> > if (num == 1){
> > document.myform.source.value="pwapprove";
> > }
> > if (num == 2){
> > document.myform.source.value="disabled";
> > }
> > if (num == 3){
> > document.myform.source.value="new";
> > }
> > document.myform.submit("/cgi-bin/clientlist.pl");
> >}
> >//-->
> ></script>
> >
> >Note that it really just has to call one script, but feed it different
> >values for the same named variable.
> >
> >Further down in the html generated by the script that created
> this page in
> >the first place:
> >
> ><form name="myform" method="post">
> ><input type=hidden name=uid value="$uid">
> ><input type=hidden name=first_name value="$first_name">
> ><input type=hidden name=source value="0">
> >
> >The $uid and $first_name are filled in by the perl script that generated
> the
> >page.
> >
> >and...the image buttons:
> >
> ><input type="image" name="I1" onclick="gowhere(1)"
> >src="/test/images/n_s_passwordrequests.gif" width=139 height=22 alt=""
> >border="0"><br>
> >
> ><input type="image" name="I2" onclick="gowhere(2)"
> >src="/test/images/n_s_disabledclients.gif" width=139 height=20 alt=""
> >border="0"><br>
> >
> ><input type="image" name="I3" onclick="gowhere(3)"
> >src="/test/images/n_s_makenewclient.gif" width=139 height=20 alt=""
> >border="0">
> >
> >Any ideas why I'm getting a reload of the page, instead of a post to the
> >proper script?
> >
> >Thanks, I've gotta dig into this javascript stuff more...
> >
> >Jack
> >
> >____________________________________________________________________
> >--------------------------------------------------------------------
> > Join The Web Consultants Association : Register on our web site Now
> >Web Consultants Web Site : http://just4u.com/webconsultants
> >If you lose the instructions All subscription/unsubscribing can be done
> >directly from our website for all our lists.
> >---------------------------------------------------------------------
>
> ____________________________________________________________________
> --------------------------------------------------------------------
> Join The Web Consultants Association : Register on our web site Now
> Web Consultants Web Site : http://just4u.com/webconsultants
> If you lose the instructions All subscription/unsubscribing can be done
> directly from our website for all our lists.
> ---------------------------------------------------------------------
>
____________________________________________________________________
--------------------------------------------------------------------
Join The Web Consultants Association : Register on our web site Now
Web Consultants Web Site : http://just4u.com/webconsultants
If you lose the instructions All subscription/unsubscribing can be done
directly from our website for all our lists.
---------------------------------------------------------------------