Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Rollover Submit Image: Other Settings

By default, all the rollover submit script requires is the sources of the "over" and "out" images and a nickname for the image. The script allows you to set a few other optional settings as well:

<FORM ACTION="../cgi-bin/mycgi.pl" NAME="myform">
email: <INPUT NAME="email">

<SCRIPT TYPE="text/javascript">
<!--
var sr = new submitroll("submit.out.gif","submit.over.gif","mysubmit");
sr.alt="OK";
sr.width=60;
sr.height=60;
sr.otheratts="ALIGN=TOP";
sr.write();
//-->
</SCRIPT>

<NOSCRIPT>
<INPUT TYPE=SUBMIT VALUE="Go!">
</NOSCRIPT>

</FORM>

email:
The code here is almost the same as in our previous example. This time we've just added a few lines.

By default the alternate text for the image is Submit Query. In our example above, sr.alt="OK"; sets the alternate text as "OK" to match the text in the image.

sr.width=60; and sr.height=60; set the width and height of the image.

Finally, the script gives an opportunity to add some attributes to the <IMG ...> tag. In this the form looks better if the text field is aligned with the top of the image instead of the bottom so we add sr.otheratts="ALIGN=TOP";.

 
 
  Copyright 1997-2002 Idocs inc. Published under the terms of the Open Content License Design by Interspire