|
If your CGIDEV2 template looks like this...
/$select
<select>
<option /%selecteda%/>A</option>
<option /%selectedb%/>B</option>
<option /%selectedc%/>C</option>
</select>
The first time you display the template, just set the variables to no
string:
c callp updhtmlvar('selecteda':'')
c callp updhtmlvar('selectedb':'')
c callp updhtmlvar('selectedc':'')
On subsequent form returns, you can dynamically turn on the select status
c if option = selectedoption
c callp updhtmlvar('selected'+%trim(option) : 'selected' )
c else
c callp updhtmlvar('selected'+%trim(option) : '')
c endif
This is a way of doing it without explicitly generating the select
information programmatically. CGIDEV2 might have a better way, but I haven't
explored it fully.
HTH,
Loyd
-----Original Message-----
From: Bartell, Aaron L. (TC) [mailto:ALBartell@taylorcorp.com]
Sent: Monday, January 14, 2002 9:24 AM
To: 'web400@midrange.com'
Subject: RE: [WEB400] First Internet application
I have a question about putting HTML in the CGI program. If I have
drop-down list box is there a way for me to return back to the user what
they selected without dynamically coding the <select> tag in RPG. For
example if I outputted this HTML the first time:
<select>
<option>A</option>
<option>B</option>
<option>C</option>
</select>
and the user selected option C. So now when I re-display the page I want
that to be selected I now have to code the select statement like this:
<select>
<option>A</option>
<option>B</option>
<option selected>C</option>
</select>
Is there a way to do this in a template?
I have gone the route where I try to have as much HTML in the IFS as
possible, and then I read it into my program at the appropriate time. But I
have noticed that it comes to a point where I forget what pieces of HTML I
coded in my program what I coded in the IFS so I start a hide and seek game.
So right now I code most off my HTML in my CGI programs and bigger chunks of
HTML in the IFS.
>From what I have read CGIDEV would fix most of my problems and I just need
to take the time to learn it.
Aaron Bartell
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.