[thelist] JS or No JS - making a form submit from a graphic button

Simon sentient at mail.com
Mon Sep 11 11:06:11 CDT 2000

Thanks to all who offered suggestions (here and privately) on how to 
work with graphic buttons for submitting forms. I think I have just 
one more question about this and I can finally move this from concept 
to production stage.

What I'm trying (failing) to do below is provide the graphic button 
with MouseUp/Down for those who have Javascript enabled. The second 
part, the NOSCRIPT section, seems to work just fine, putting the 
regular clickable button in place when the browsers have JS turned 
off. But I'm just too much of a JS beginner to be able to see where 
in the SCRIPT section I've gone wrong. I've got the things I want to 
happen in there but my construction must be off. I tried adding a 
 ; return true;    after the href part in the SCRIPT section but that 
doesn't seem to make a difference, still nothing appears.

Could one of the Javascript mavens on the list offer a suggestion on 
getting this to work? Or feel free to hack it apart and tell me the 
better way(s) to do this . . .

document.write('<a href="javascript:document.forms['subForm'].submit()"
onmouseout="changeImages('subPop9_07', 'slices9/subPop9_07.gif'); return true;" 
onmousedown="changeImages('subPop9_07', 'slices9/subPop9_07-down.gif'); return true;" 
onmouseup="changeImages('subPop9_07', 'slices9/subPop9_07.gif'); return true;">
<img name="subPop9_07" src="slices9/subPop9_07.gif" 
 width="151" height="39" border="0"></a>')
<input type=image src="slices9/subPop9_07.gif" width=120 height=37 border=0 
alt="click to subscribe" title="enter your email address and click the Subscribe button">

I left the table cell tags in just in case that would affect 
construction somehow.

Thanks in advance to any who can help!


"I've always wanted to be somebody, but now I see 
  I should have been more specific."  . . . Lily Tomlin


Sentient Technologies - mailto:sentient at mail.com

More information about the thelist mailing list