Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Handling Image Input

Handling Image Input

  • As you saw earlier, it is very easy to use the NAME value of an HTML SUBMIT button to determine which action to perform in a script. Thus, we typically see code as follows:

    if (delete button ne "")
      {
      do something
      }
    

  • In other words, if the user has clicked the delete button (and the delete button has been assigned the VALUE), we will perform a deletion. If however, some other button is pressed, the VALUE of the delete button will be null and the action will not be performed.

  • However, what if the user clicked an INPUT TYPE = "image" button?

  • In this case, we will use similar logic...
    if ($form_data{'delete_image.y'} > 0)
      {
      do something
      }
    

  • As you can see, the script checks to see if the y coordinate has been assigned a value (meaning the user clicked on it) and if so, performs an action.

Additional Resources:

Non-Parsed Header Scripts
Table of Contents
Debugging CGI Scripts


Up to => Home / Authoring / Scripting / Tutorial




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers