O
OriginalBrownster
Hi there...
I have a little problem using some javascript in my web app. The app
seems to work fine in IE but when i use firefox to view it..the
javascript doesn't seem to work....
I am using turbogears to make my app..but the layout is mostely html
and css
Heres the page thats giving me the troulbe
<table border="0">
<dl xmlnsy="http://purl.org/kid/ns#" class="${field_class}"
id="${field_id}"
py:attrs="list_attrs">
<?python x=1 ?>
<DT py:for="i in xrange(0, len(options))">
<?python value, desc, attrs = options ?>
<?python blurb = blurbs ?>
<tr border="1">
<td align="left" valign="top">
<input type="radio" name="${name}"
id="${field_id}_${value}" value="${value}"
py:attrs="attrs" />
</td>
<td align="left">
<div id="${x}" class="mborder" style="width:300px;
height:20px;
background:#FFFFFF;overflow:hidden;">
<STRONG>
<label for="${field_id}_${value}" py:content="desc"
/>
</STRONG>
<DD>${blurb}</DD>
</div>
</td>
<td align="left" valign="top">
<img src="/static/images/arrowd.gif" alt="arrow
down" title="click to view"
onclick="showm('${x}','${x}')" id="${x}"/>
</td>
</tr>
<?python x=x+1 ?>
</DT>
</dl>
</table>
The line thats giving me the trouble is the:
<img src="/static/images/arrowd.gif" alt="arrow down" title="click to
view"
onclick="showm('${x}','${x}')" id="${x}"/>
that onclick is sending that function to javascript in the head..here
it is
<script type="text/javascript">
var doit = true
function showm(ob,pict) {
if(doit) {
document.getElementById(ob).style.height = '120'
doit = false
}
else {
document.getElementById(ob).style.height = '20'
doit = true
}
}
</script>
I am not totally sure if this is a problem with the javascript or the
use of css and changing the div size...
Any suggestions would help
I have a little problem using some javascript in my web app. The app
seems to work fine in IE but when i use firefox to view it..the
javascript doesn't seem to work....
I am using turbogears to make my app..but the layout is mostely html
and css
Heres the page thats giving me the troulbe
<table border="0">
<dl xmlnsy="http://purl.org/kid/ns#" class="${field_class}"
id="${field_id}"
py:attrs="list_attrs">
<?python x=1 ?>
<DT py:for="i in xrange(0, len(options))">
<?python value, desc, attrs = options ?>
<?python blurb = blurbs ?>
<tr border="1">
<td align="left" valign="top">
<input type="radio" name="${name}"
id="${field_id}_${value}" value="${value}"
py:attrs="attrs" />
</td>
<td align="left">
<div id="${x}" class="mborder" style="width:300px;
height:20px;
background:#FFFFFF;overflow:hidden;">
<STRONG>
<label for="${field_id}_${value}" py:content="desc"
/>
</STRONG>
<DD>${blurb}</DD>
</div>
</td>
<td align="left" valign="top">
<img src="/static/images/arrowd.gif" alt="arrow
down" title="click to view"
onclick="showm('${x}','${x}')" id="${x}"/>
</td>
</tr>
<?python x=x+1 ?>
</DT>
</dl>
</table>
The line thats giving me the trouble is the:
<img src="/static/images/arrowd.gif" alt="arrow down" title="click to
view"
onclick="showm('${x}','${x}')" id="${x}"/>
that onclick is sending that function to javascript in the head..here
it is
<script type="text/javascript">
var doit = true
function showm(ob,pict) {
if(doit) {
document.getElementById(ob).style.height = '120'
doit = false
}
else {
document.getElementById(ob).style.height = '20'
doit = true
}
}
</script>
I am not totally sure if this is a problem with the javascript or the
use of css and changing the div size...
Any suggestions would help