HTML
  Home arrow HTML arrow Page 5 - Building Single Row Database Forms with HT...
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

Building Single Row Database Forms with HTML
By: Chrysanthus Forcha
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 4
    2008-07-16

    Table of Contents:
  • Building Single Row Database Forms with HTML
  • Sending Changes to Server Database
  • The Form Code
  • The Nature of the Recordset
  • The disableButtons(selectedButtons) Function

  • 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


    Building Single Row Database Forms with HTML - The disableButtons(selectedButtons) Function


    (Page 5 of 5 )

    Before I give you the code for this function, let me first describe a JavaScript feature that you may not be familiar with. When you call a JavaScript function, the called function develops an internal array. The first element ([0]) of this array holds the first argument of the parameter list of arguments received by the function, the second element of the array holds the second argument of the parameter list, the third element holds the third argument, and so on. The length of the array is the number of arguments in the parameter list. The length of the array depends on the number of arguments you send in the parameter list and this number depends on you.

    I use this feature in this function - "disableButtons(selectedButtons).” The name of this array is “arguments.” This name is given by JavaScript and is the same for all JavaScript functions called. The array is internal to the function and you do not see its construction. To obtain its length, you type “arguments.length.” The “disableButtons(selectedButtons)” function is used to disable the selected button. The “selectedButtons” parameter simply represents the list of IDs of the buttons you want disabled. The list can be of any length. The code for the function is:


    function disableButtons(selectedButtons)

    {

    for (i=0; i<arguments.length; i++)

    {

    document.getElementById(arguments[i]).disabled = true;

    }

    }


    You do not access the IDs using “selectedButtons,” you access them using “arguments[i].”

    The enableButtons(selectedButtons)

    You use this function to enable selected buttons. The explanation is similar to the one above. The code is:


    function enableButtons(selectedButtons)

    {

    for (i=0; i<arguments.length; i++)

    {

    document.getElementById(arguments[i]).disabled = false;

    }

    }


    The clearControls() Function

    This function is used to clear the text Input controls, NOT the values in the rows of the recordset. You achieve this by setting the value of a text Input element to “”. The code is:


    function clearControls()

    {

    for (j=0;j<6;j++)

    {

    ID = "EI" + j; //forming the control ID

    document.getElementById(ID).value = "";

    }

    }


    These are common functions written by us to use.

    We continue in the next part of the series.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · The story continues.Chrys
       · Hi I really thankful to you because you are simply greatI am very happy to post my...
       · You are welcome Dating.Chrys (author)
     

    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
    Stay green...Green IT