|
It always seems kinda dicey to me to reference things in javascript, plus
the fact that it can cause the screen to change as it is being rendered.
Why not try and resolve things on the server when possible and avoid the
js. I don't know if the syntax is exactly right but I think you can see
what I'm getting at.
<INPUT TYPE="radio"
NAME="POPUR"
onClick="set_trans_opt(l1_SCRN01$SELPO,l1_SCRN01$SELPRT,'X', '
');"
<%if(SCRN01.getFieldValue("SELPO").charAt(0)=='X'){%>SELECTED<%}%>
>PO #<BR>
Mike
Mike Hockings, P.Eng.
WebSphere Development Tools for AS/400 - CODE/Designer & WebFacing !
IBM Canada Ltd. Laboratory
hockings@xxxxxxxxxx
"Mark Giordano" <mgiordano@xxxxxxxxxxxxxxxxxxx>
Sent by: wdsci-l-bounces@xxxxxxxxxxxx
2004-10-04 14:29
Please respond to
Websphere Development Studio Client for iSeries
To
<wdsci-l@xxxxxxxxxxxx>
cc
Subject
[WDSCI-L] Radio Button Troubles
I would like a radio button selected by default when the page loads
and then keep either the original selection or the new selection when the
page reloads. I tried using the keyword CHECKED within the Html tag but
it
always selcted that value. I added the following script to hold the value
after it was selected before the radio buttons were defined:
if (l1_SCRN01$SELPO.value == 'X') document.SCREEN.POPUR[0].checked = true;
if (l1_SCRN01$SELPRT.value == 'X') document.SCREEN.POPUR[1].checked =
true;
After adding this the page did not behave as it was supposed to. Normally
I
would choose between an option and then hit Enter. It would then search
by
the appropriate selection criteria. Adding those above statements changed
that. When I take them out it works fine but I have to always select a
radio button. I used the following code below when setting up radio
buttons
within my application. Thanks.
Mark Giordano
<SPAN class="wf_default wf_field">
<INPUT TYPE="radio" NAME="POPUR"
onClick="set_trans_opt(l1_SCRN01$SELPO,l1_SCRN01$SELPRT,'X', ' ');" >PO #
<INPUT TYPE="radio" NAME="POPUR"
onClick="set_trans_opt(l1_SCRN01$SELPO,l1_SCRN01$SELPRT,' ','X');">Part
No.
</SPAN>
The function set_trans_opt is as follows:
function set_trans_opt(field1,field2,value1,value2){
field1.value = value1;
field2.value = value2;
setFocusAndValue(field1,value1)
setFocusAndValue(field2,value2)}
_______________________________________________
This is the Websphere Development Studio Client for iSeries (WDSCI-L)
mailing list
To post a message email: WDSCI-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/wdsci-l
or email: WDSCI-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/wdsci-l.
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.