× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Peter-
Peter-
The JavaScript code you wrote is checking the value of the checkbox,
which is always the same. You need to check the state ( ie is it
checked or no)  of the checkbox, which can be done as follows:
alert( Form1.rating.checked);

Also, why are you building the QueryString in your Javascript function
when the form is using the POST method?

>From looking at the Java script, the whole java script function seems
unecessary.

I would suggest changing your HTML to the following:

<form METHOD="POST" action="../Top20CusSum/report" name="Form1">

      ... some headings, other inputs.

      <input type=checkbox name="rating">

      <input type="submit" value="Display Statistics" name="B1">

</form>


What programming language is "Top20CusSum/report" written in?

HTH,
Sarah Poger Gladstone




On 1/13/06, Matt.Haas@xxxxxxxxxxx <Matt.Haas@xxxxxxxxxxx> wrote:
> Peter,
>
> Specify a value attribute for the checkbox and check to see if that
> value was passed in. If the box was checked, you'll get the value. If
> the box is not checked, you'll get nothing.
>
> Matt
>
> -----Original Message-----
> From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx]
> On Behalf Of Peter Vidal
> Sent: Friday, January 13, 2006 8:56 AM
> To: Web Enabling the AS400 / iSeries
> Subject: Re: [WEB400] ***** <input TYPE="checkbox"> issue
>
> Thanks Sarah.  I understand your explanation of the checkbox  and its
> behavior with the browser. The issue is that it does not matter if I
> check it or not, the value is
> TRUE, always TRUE, no matter what I do.  I also tested your
> recomendation
> to use "GET" but with no sucess.
>
> To give you all an idea of how thigns are rolling, this is the code:
>
> ===============================================
>
> %HTML(INPUT) {
> <html>
> <head>
>
>
> <script LANGUAGE="JavaScript">
> <!--
>
> function setParms() {
>
> alert(Form1.rating.value);
>
>  var base = "../Top20CusSum/report?";
>
>  var parms = "&co="      + Form1.co.value +
>              "&ioc="     + Form1.ioc.value +
>              "&rating="  + Form1.rating.value +
>              "&reptyp="  + Form1.reptyp.value ;
>
>  adr  = base + parms;
>
> }
> // -->
> </script>
>
>
> <style>
> <!--
> BODY {font-family: verdana, helvetica, arial, sans-serif;
> font-size:x-small}
> TABLE {font-family: verdana, helvetica, arial, sans-serif;
> font-size:x-small}
> -->
> </style>
>
> </head>
>
> <body>
>
>        ... some page headings
>
> <form METHOD="POST" action="javascript:location.href=adr" name="Form1">
>
>        ... some headings
>
>        <input type=checkbox name="rating">
>
>        <input type="submit" value="Display Statistics" name="B1"
> onClick="setParms();">
>
> </form>
> </body>
> </html>
>
> It is incredible (based on the beginner knowledge I have) that
> Form1.rating.value is always TRUE...
>
>
>
> Peter Vidal
> PALL Corporation / SR Programmer Analyst, IT Development Group
> 10540 Ridge Rd., Ste 203, New Port Richey, FL 34654-5111
> http://www.pall.com
>
> "Labor to keep alive in your heart that little spark of celestial fire -
>
> Conscience."
> George Washington
>
> --
> This is the Web Enabling the AS400 / iSeries (WEB400) mailing list
> To post a message email: WEB400@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/web400
> or email: WEB400-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/web400.
>
>


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.