Closed Thread
Results 1 to 3 of 3

Thread: How to get reference to all Form elements

  1. #1
    anuj_web's Avatar
    anuj_web is offline x10 Sophmore anuj_web is an unknown quantity at this point
    Join Date
    Dec 2007
    Posts
    145

    How to get reference to all Form elements

    Hi

    I want to check for all elements if they are blank or not
    all at once
    bcoz i have too many text boxes...


    Is there ne javascript method for the form to check this ??

    thanks

  2. #2
    phpasks is offline x10 Sophmore phpasks is an unknown quantity at this point
    Join Date
    Apr 2008
    Posts
    145

    Thumbs up Re: How to get reference to all Form elements

    You can use prototype.js file
    Download prototype js file
    http://www.phpasks.com/ajax/prototype-framework.html
    HTML Code:
    <Script>
    function submit_username123_show(){
        for(var i=0;i< $('form123').length;i++)
        {
           if($('form123')[i].type=='textbox' && $('form123')[i].value=='')
          {
               alert('please filled up');
          }
        }
    }
    </script>

    Asif
    http://www.phpasks.com

  3. #3
    anuj_web's Avatar
    anuj_web is offline x10 Sophmore anuj_web is an unknown quantity at this point
    Join Date
    Dec 2007
    Posts
    145

    Re: How to get reference to all Form elements

    Thanks Asif for that quick reply.....


    I found this while googling....

    Code:
    <script>
    	function disableForm(theform) {
    		if (document.all || document.getElementById) {
    			for (i = 0; i < theform.length; i++) {
    			var formElement = theform.elements[i];
    				if (true) {
    					formElement.disabled = true;
    				}
    			}
    		}
    	}
    </script>
    thanks again

Closed Thread

Similar Threads

  1. Addon Domain PHP Form Error
    By rockee in forum Free Hosting
    Replies: 2
    Last Post: 04-02-2008, 06:53 PM
  2. Design a free form
    By gateway in forum Off Topic
    Replies: 1
    Last Post: 10-19-2007, 05:49 PM
  3. My php Form tutorial
    By WinGate in forum Tutorials
    Replies: 0
    Last Post: 08-20-2007, 08:14 PM
  4. Frontpage Form Problem
    By geek2009 in forum Scripts & 3rd Party Apps
    Replies: 2
    Last Post: 07-03-2007, 10:18 AM
  5. A simple Visual Basic Login Form
    By Zenax in forum Tutorials
    Replies: 0
    Last Post: 03-13-2007, 08:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers