HTML
  Home arrow HTML arrow Submitting a Form Using an Image Tag
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
HTML

Submitting a Form Using an Image Tag
By: Chris Root
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 18
    2005-04-18

    Table of Contents:
  • Submitting a Form Using an Image Tag
  • Submitting a Form
  • Processing the Form
  • The Server Side Code
  • GD Methods
  • Handling the Name
  • The TextBox Class
  • From the Top

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Submitting a Form Using an Image Tag


    (Page 1 of 8 )

    There are a number of ways to make the forms on your website more user friendly. This article will explain one way of doing this, which eliminates a page reload and replaces it with an image generated on the server.

    Forms on the Web are somewhat user unfriendly. One of the worst parts of using a form on a website is page reloads. Many times, after submitting a form, you are taken to a confirmation page, which provides links to go somewhere else rather then allowing you to submit the information and get on with your life.

    This article will demonstrate a way to eliminate a step by getting rid of the confirmation page and replacing it with a simple image generated by the server. There are no page loads; just a little Javascript, server side code and an HTML "img" tag.

    Image Generation

    There are many server side Web application platforms that provide a way to generate graphics "on the fly" either built into the application language or via some sort of extension.

    Most of these systems work with HTML in a very simple manner. Rather than using a path to an image in the src attribute of an image tag, the path to a coded page is used. This coded page (such as a PHP or ASP page) generates the graphics, assembles the proper HTTP headers and then sends the response as an image rather than an HTML document.

    <img src="img_generate.php">

    Many times this is used to display bar graphs, pie charts or other graphics assembled using information in a database.

    Since we are sending the request to a Web application, there is nothing that says that we can't send more than just the path to the application.

    In a standard GET style HTTP request (like a page request), a query string is used to send additional information to the server. A query string is made up of a "?" character followed by one or more name/value pairs separated by an "&", and encoded to escape characters such as spaces that are not allowed in URLs.

    http://www.mydomain.com/products.asp?cat=lawnGard&subcat=lawmowers

    A query string can be appended to any URL. As long as the target of the request is able to process and use the query string, then we have something useful. A static image of course has no use for query strings; a Web application can do quite a lot with one, however.

    More HTML Articles
    More By Chris Root


       · That needs JavaScript to submit a form?At least have a server side validation and...
       · I specifically left validation up to the reader as validation is a topic all by...
       · Accessibility means that you make sure anyone can use the application regardless of...
       · I did not mean to imply that I ignore accessibility in my real projects. I always...
       · I've been using a hidden IFrame to handle form submissions - the web page shunts all...
       · For 'Anonymous Loozah #1'there are many ways to submit forms on the web... some...
     

    HTML ARTICLES

    - Comparing Browser Response to Active Client ...
    - Testing Browser Response to Active Client Pa...
    - Active Client Pages: Completing the Code for...
    - ACP and Browsers: Setting up an Example
    - How Browsers Respond to Active Client Pages
    - Completing a Tree with Active Client Pages
    - HTML Form Verification and ACP
    - Building an ACP Tree
    - Completing an ACP 3D HTML Table Image Gallery
    - Building an ACP 3D HTML Table Image Gallery
    - A Multiple Page Image Gallery with Active Cl...
    - Building an Image Gallery with Active Client...
    - Concluding a Menu for All Browsers
    - A Vertical Menu for All Browsers
    - Downloading Long HTML Pages with ACP







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek