I did not read any HTML documentation about ‘radio’ type of input, but I can notice one problem in your html: both values - yes and no- have to have the same name.

Your html should read:

<input name="yes" type="radio" value="Y">Yes
  <input name="yes" type="radio" value="N">No

Then you would retrieve the variable ‘yes’ in your RPG program and check the values.

Here it is an example of how I did this:

<tr>                                                                       

  <td>Legalization</td>                                                    

  <td width="200"><input type="radio" value ="Y" name="Doc1" /%check1%/>Yes</td>

  <td width="200"><input type="radio" value ="N" name="Doc1" /%check2%/>No</td>

</tr>                                                                      


Then in the RPG program:

. . . input

 

 AppDoc1 = ZhbGetVar ('Doc1');

 

. . . process

 

 if  AppDoc1 = 'Y';

    check1 = 'checked';

    check2 = *blanks;

 else;

    check1 = *blanks;

    check2 = 'checked';

 endif;

 

. . . output

 

callp  UpdHtmlVar ('check1':check1);

callp  UpdHtmlVar ('check2':check2);

 

Adriana

 

 

 


From: [email protected] [mailto:[email protected]] On Behalf Of bluesmanq
Sent: Monday, December 19, 2005 5:36 PM
To: [email protected]
Subject: [Easy400Group] more radio button confusion??

 

I cannot get the vaule of a radio button returned to the rpg program.
It "looks" very simple... Here's what I have in the html:

<html>
<head>
<title>Test Radio Button</title>
</head>
<body>
<form action="">
  <input name="yes" type="radio" value="Y">Yes
  <input name="no" type="radio" value="N">No
  <br><br>
  <input type="submit" value="Submit">
</form>
</body>
</html>

Here's my RPG:

H DFTACTGRP(*NO) BNDDIR('DRXCGI/TEMPLATE2')                  
/COPY qrpglesrc,PROTOTYPEB                                  
/copy qrpglesrc,variables3                                  
/COPY qrpglesrc,USEC                                        
D path            s           1024a                          
D yes             s              1a                          
D no              s              1a                          
/free                                                       
                                                             
   yes = ZhbGetVar('yes');                                   
   no  = ZhbGetVar('no');                                    
   ClrHtmlBuffer();                                          
                                                             
    updHTMLvar('yesval':yes);                                
    updHTMLvar('noval':no);                                  
                                                             
   path = '/drxcgi/html/radioout.htm';           
   GetHtmlIfs(Path);                                         
   wrtsection('all');                                        
   wrtsection('*fini');
   *inlr=*on;
/end-free                                        

the input values of 'yes' and 'no', with debug on, are always blank
no matter which button is clicked or if both are clicked.. Therefore,
the resulting variables 'yesval' and 'noval' are always blank.

Did I miss something?????

thanks!



--- In [email protected], [EMAIL PROTECTED] wrote:
>
> The sample andrew gave below was correct for receiving the value of
the
> radio button, but it doesn't handle setting the radio selection
when the
> output is created.  You need to add the CHECKED keyword to the
option that
> is selected.
>
> Example
>
> <INPUT TYPE="RADIO" NAME="statut" VALUE="1" /%STATUTOUI%/>Oui
> <INPUT TYPE="RADIO" NAME="statut" VALUE="2" /%STATUTNON%/>Non
>
> Then when you are writting the html
> IF STATUT='1'
> UPDHTMLVAR('STATUTOUI':'CHECKED')
> UPDHTMLVAR('STATUTNON':' ')
> else
> UPDHTMLVAR('STATUTOUI':' ')
> UPDHTMLVAR('STATUTNON':'CHECKED')
> endif
>
> Kevin Rowles
> Data Management
> Telephone: 336-573-5020
> Fax: 336-573-5001
>
>
>                                                                    
      
>              "andrew_david_ker                                     
      
>             
r"                                                           
>             
<andrew_david_ker                                          To
>              [EMAIL PROTECTED]>           
[email protected]       
>              Sent
by:                                                   cc
>             
[EMAIL PROTECTED]                                            
>              ogroups.com                                          
Subject
>                                        [Easy400Group] Re: How to
recover  
>                                        the value of a Radio
zone          
>              11/30/2005
06:20                                             
>             
AM                                                           
>                                                                    
      
>                                                                    
      
>              Please respond
to                                            
>             
[EMAIL PROTECTED]                                            
>                
ogroups.com                                               
>                                                                    
      
>                                                                    
      
>
>
>
>
> Hi there,
>
> How are you validating your date? If possible you would be doing
this
> with client side script, and hence not 'losing' the value of the
> radio zone (no CGI call in the event of a invalid date). But in the
> event that you have to validate against value(s)in your db, your
call
> to the CGI program would return the value of the radio zone like any
> other variable on your form.
>
> Example
>
> <INPUT TYPE="RADIO" NAME="statut" VALUE="1" >Oui
> <INPUT TYPE="RADIO" NAME="statut" VALUE="2" >Non
>
> d statut          s              1a
> .
> .
> /free
>    statut = zhbgetvar('statut');
> /end-free
>
> Only other thing to check is that the radio zone is defined within
> the HTML form that does the actual call to the CGI program.
>
> Any help?
>
> Andrew
>
> --- In [email protected], "lpt_fr" <[EMAIL PROTECTED]>
wrote:
> >
> > Hello,
> >
> > I'm afraid I'm asking a very basic question but I can't find the
> > solution of my problem.
> >
> > I've got a simple form where I have to type a date and choose an
> option
> > proposed in a radio zone (3 choices). If I fill this form with a
> wrong
> > date, I re-display the form with an error message.
> > My problem is that I don't know how to recover the previous value
> of my
> > radio zone. I've tried different ways of getting this value using
> > zhbgetvar (even with multi occurences) but couldn't make it work.
> >
> > Could someone provide me a sample of HTML and RPG source that
works?
> >
> > Thanks.
> >
>
>
>
>
>
>
>                                                            
SPONSORED LINKS
>                                                                   
>  How to format a computer hard    Cobol programmer   Iseries 400  
>  drive                                                            
>                                                                   
>  How to format a computer                                         
>                                                                   
>
>
>                             YAHOO! GROUPS LINKS
>
>        Visit your group "Easy400Group" on the web.
>
>        To unsubscribe from this group, send an email to:
>        [EMAIL PROTECTED]
>
>        Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service.
>






Email Confidentiality Notice and Disclaimer
 
This email message contains information which may be confidential and or legally privileged. Unless you are the intended recipient (or have been authorised to receive on behalf of the intended recipient), you may not use, copy or disclose to anyone the message or any information contained in the message or from any attachments that were sent with this email. If you have received this email message in error, please advise the sender by email, and delete the message.

All business and transactions of whatsoever nature be it as agent or as principal with any party whatsoever shall solely be conducted in accordance with our Standard Trading Conditions. These conditions have clauses that may limit our liability. A copy of our Standard Terms is available on request. When an air waybill or bill of lading or any other international consignment note is issued, the conditions that apply for such a document will be in addition to our Standard Trading Conditions, and for the relative air or sea or other mode of transport leg / movement only, they will be paramount.




YAHOO! GROUPS LINKS




Reply via email to