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="/drxcgip/radio1.pgm">
  <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.
>






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/2jUsvC/tzNLAA/TtwFAA/wbFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/Easy400Group/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to