codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:

Home » Javascript » Article

Javascript - Enable and Disable form elements

Article by:  Jeff Anderson  ( 1362 ) (3/6/2002)
Bookmark us now! Add to Favourites
Email a friend!Tell a friend
Summary: This is a relatively little known and under-used feature of javascript which can be very useful in guiding a user through a form. Using the disabled tag, you can switch on and off elements in a form.
Viewed: 1281941 times Rating (477 votes): 
 4.1 out of 5
 Rate this Article  Read Comments  Post Comments


This is a relatively little known and under-used feature of javascript which can be very useful in guiding a user through a form. Using the disabled tag, you can switch on and off elements in a form.

Here is a standard text field:



Now here it is again, disabled:



Try typing in the second box, and you'll see that you can't - it's been disabled. You can do the same any other elements in a form - checkboxes, selection boxes and the rest.

Disabling Form Elements - Common Uses

One common use of this is to only enable the element, once the appropriate field has been selected earlier in the form.

Now here's a practical example. The 'explain your choice' field only becomes enabled when I have selected the answer to Question 1. Before selecting a radio button, try typing in the text field - you can't!

Question 1
Answer a:
Answer b:

Explain your choice:



Disabling Form Elements - How it's done

To disable an element, put the phrase disabled="true" within the element tag.



Once you've set the disabled tag, you can enable it using something like the following code:


 
<script language="javascript">

function enableField()
{
document.form1.address2.disabled=false;
}
 
</script>

<a href="javascript:enableField()">Click here to enable the element<a/>



With disabled set to false, the form element becomes useable.






CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
Rate this article:     Poor Excellent
View highlighted Comments
User Comments on ' Javascript - Enable and Disable form elements'
Posted by :  Archive Import (Sujatha) at 08:46 on Friday, September 27, 2002
HI!!!

I am new to javascript and hence always browse the net trying to learn it. New doesn't mean I am starting from scratch. It just means i am developing with it right now only. Well I found this article useful. It was easy to understand and to the point .. not like some which cover the depths unnecessarily.

Good Work. :)
Posted by :  Archive Import (mike) at 22:45 on Tuesday, October 01, 2002
ok... i want to have the option on my site of selecting black and white or color with 2 checkboxes, which when you select one, it will bring up a pull down menu, which will have different sizes listed...
can you help me?
Posted by :  Archive Import (Ace) at 09:19 on Monday, October 28, 2002
I am using an image as a submit button:

<INPUT type="image" name="submitImage" src="something.jpg">

In the onsubmit event for the form(which passes the form), I have this:

frm.submitImage.disabled=true;

I am still able to click on the image and submit the form over and over, however. Is there something special I need to do to disable this type of form element?

I would like to prevent people from clicking the submit button (Image) more than once.

Thanks,
Ace
Posted by :  Archive Import (Dave) at 03:11 on Tuesday, October 29, 2002
Ace - does the same code work with a standard submit button - maybe you can't disable an image button - I've never tried it. Also you could try putting it in the onclick event of the button and see if that does anything, or even set a global variable which gets changed the first time you click and if its changed the form doesn't submit - I'm sure it should be possible the way you're doing it though.
Let us know if you crack it!
Posted by :  Archive Import (Wiz) at 20:20 on Tuesday, November 05, 2002
Use document.form.button.disable=true;

example:
frm.submitImage.submitImage.disabled=true;

-Enjoy
Posted by :  Archive Import ( ) at 05:36 on Wednesday, November 13, 2002
Posted by :  Archive Import (clintonG) at 12:24 on Thursday, November 14, 2002
This does not appear to function for me using IE6
Posted by :  Archive Import (vellay) at 21:01 on Sunday, November 24, 2002
your code will never work in nn4.7
Posted by :  Archive Import (cicagakid) at 23:58 on Wednesday, December 04, 2002
who cares about netscape?

the example above with the radio buttons and text field did not work for me.

WIN98 - IE6
Posted by :  Archive Import (Bill) at 17:04 on Wednesday, December 11, 2002
I am trying to use this script in a asp page and am not having much luck in making it work. Any suggestions?
Posted by :  Archive Import (Tez_Guy) at 02:06 on Monday, December 16, 2002
Hi all!!
How to make the disabling scripts work for both netscape and IE? Are'nt there any standard functions one can use for disabling form elements.
Another query is how to disable the file type input box alongwith the browse button??
Any suggestions are welcome...
Posted by :  Archive Import (pete) at 09:17 on Thursday, January 02, 2003
I got a javascript error from your example ;-)
Posted by :  Archive Import (matt) at 11:41 on Monday, January 06, 2003
thanks it works. Did one search and found this. IE6 something. Don't know if works in NS, but its for work, and we only use IE.
Posted by :  Archive Import (Neil Chuckervertty) at 06:39 on Thursday, January 09, 2003
Check your own site lots of javascript errors, ill correct it i work for freelancing.
bye
Posted by :  Archive Import (Sameer) at 06:51 on Wednesday, January 15, 2003
I am using an image as a button

<a href="javascript:trySave()" ><img name="save" border="0" src="save.gif" ></a>

In trySave() java script I have written
document.frm.save.disabled=true;

I am still able to click on the image second time.I want to disable it after clicking once
Posted by :  Archive Import (Afterdark) at 18:32 on Wednesday, January 15, 2003
Nice peice of code, simple, to the point & functional. Many Thanks
Posted by :  Archive Import (Erika) at 09:24 on Wednesday, January 29, 2003
Is there a way to have the appearance of the text box change so that it looks disabled?
Posted by :  Archive Import (Wael Shubeir) at 05:20 on Tuesday, February 04, 2003
Is there a way to create new form elements (e.g. input textbox) and display it according to user action.

Example:
When the user enters article number, a new textbox will be displayed.

Thanks
Posted by :  Archive Import (Surya) at 15:35 on Saturday, February 08, 2003
How do i disable a button if the submission date of a form equals to the current date?
Thanks!
Posted by :  Archive Import (anonymous) at 13:50 on Thursday, March 06, 2003
For those of you who are having trouble disabling <input type="image" submit button problems.. I was able to make it work.

I just called onclick="var obj =disable(this);" for the submit button. I then had an onSubmit event for my form and passed in obj.

ie onSubmit="return disablebutton(obj);"
function disablebutton(obj){
obj.disabled=true;
}

I hope this helps..
Posted by :  Archive Import (Nicu) at 13:11 on Thursday, March 13, 2003
I need a java script that does the following: i have a banner and a disabled button on a page. the button will become enabled only when someone clicks the banner first. if someone cand help me pls mail me at perf_uzzi@cogeco.ca 10x
Posted by :  Archive Import (amit singh) at 01:14 on Friday, April 25, 2003
in one html form , we use many button,list box.when user select one buttun then all buttun in form should disable.we this do in javascript.
Posted by :  Archive Import (Guy Derriman) at 05:13 on Wednesday, April 30, 2003
This worked for me in IE 6

if (document.getElementById("_ctl0_pPrimaryFromCalendar_pDateImgBtn") != null)
{
var pPrimaryFromCalendarDateImgBtn = document.getElementById("_ctl0_pPrimaryFromCalendar_pDateImgBtn");
pPrimaryFromCalendarDateImgBtn.disabled = true;
}
Posted by :  Archive Import (Roks James from Win infy tech NY) at 09:44 on Wednesday, April 30, 2003
We have 2 text field. and 2 radio buttons.
if we select one radio button the one text field should avtivate and rest of the text fields should deactivate (greyed).
Kindly suggest the code or script if any java script guru is available on the net.
Posted by :  Archive Import (harry foxluv) at 11:20 on Thursday, May 01, 2003
Actually I have a question of my own on 'How To Disable a Function' using Java Script.

I know how to use some Java Script. I can disable the "Right Click Mouse Function" and Put a "BOX" with text.

What I want to do on my Website is disable the webpage "COPY" function in IE 6.0 0r above ...
File
Save As

- and -
If possible, I would also like to disable the "PRINT" function in IE as well.
File
Print

I have searched many places but have not been able to find anyone who knows how to disable these functions.

Disabling the entire IE File Menu would be acceptable, but not preferable.

Can you assist me?
I am pretty new at this overall.
If you could give me the Java Script or HTML Code to insert that would be best.
Thanks,
Harry
Posted by :  Archive Import (siva) at 04:32 on Thursday, May 29, 2003
PLZ HELP ME -- URGENT

THANKS IN ADVANCE

I HAVE SOME BUTTONS IN MY SCREEN.

I HAVE TO DISABLE SOME BUTTONS IF THE CONDITION IS TRUE ELSE THE OTHER BUTTONS TO BE DISABLED.

I HAVE GIVEN THESE BUTTONS IN THE <FILEDSET> TAG.

MY FORM NAME IS MYFORM -- THE CODE IS
DOCUMENT.MYFORM.REM_DELETE.DISABLED=TRUE

IT'S THROWING AN ERROR AS 'REM_DELETE' IS NOT AN OBJECT.

WHY IT IS SO????
Posted by :  Archive Import (xrellix) at 16:34 on Friday, May 30, 2003
If u have a submit input of type image (rather than a button) then use the following
method to disable the image and submit the form:

<input name="Search" type="image" src="/resources/images/buttons/search_bt_bl.gif" onclick="doSubmit(this)"></td>

function doSubmit(submitTypImage) {
submitTypImage.disabled = true;
submitTypImage.form.submit();
}

When u have a submit button (rather than an image) u don't need to sumbit() the form explicitly,
just the disable will do. In the case of a button the form gets submitted implicitly by the browser
when its clicked and so u can just have onclick="this.disabled=true" right on the <input> tag.
This is however not true for image type input submits.
Posted by :  Archive Import (Ali) at 11:23 on Wednesday, June 04, 2003
Still I can't disable the image submit button :(

I have the following example:

<SCRIPT language=JavaScript> function Validate(FormName) {
if (FormName.FieldName.value == "") {
alert("Field is Null");
return (false);
}
FormName.SubmitImage.disabled=true;
return (true);
} </script>
<form name="FormName" action="test.html" onSubmit="return Validate(this)">
<input name="FieldName"><input type="Image" src="Image.gif" name="SubmitImage">
</form>
Posted by :  Archive Import (Olivier) at 08:34 on Monday, June 16, 2003
disable and image type buttons...

an easy way to do it :
use a function to check your different fields...

<FORM NAME="the_form" ACTION="..." METHOD="POST" onsubmit="return check_form()">

<script language="JavaScript">
var submitted=false;
function check_form() {
if (submitted == true) {
alert ("form already submitted") ;
return false;
}
else {
// everything is ok check the fields, ie using if (document.... .lenght == 0) alert...
submitted = true ;
}
}
</script>

It disables the aiblity to validate twice a form...
simple and efficient !
Posted by :  Archive Import (susmita) at 12:41 on Friday, June 20, 2003
I need a Javascript which disables the form fields only after submitting the data to a database.I am working with PHP and MS Access 2000 on an ONLINE APPLICATION.
Thanks!!
Posted by :  Archive Import (Neo) at 10:24 on Wednesday, June 25, 2003
If you want to make a script work only with IE, you are a suck webmaster, and even a stupid computer user!!
Posted by :  Archive Import (kusalo) at 02:41 on Saturday, July 05, 2003
I got it to work - excellent. I can see a variety of uses for this (tho yet to test it in NS :)

But...
to get it working I had to read the page source and extract the <form name=form22>until</form> bit before I really understood.
It would be useful to have this presented as the code snippet.

many thanks
Posted by :  Archive Import (hussain) at 07:32 on Wednesday, July 16, 2003
I need code to disable a radio button by selecting a particular value in a Drop Down Menus
Posted by :  Archive Import (test) at 08:44 on Sunday, August 03, 2003
does not work under IE 5.5
Posted by :  Archive Import (test) at 08:45 on Sunday, August 03, 2003
Would be nice to disable the 'Submit Comment' button in this page no ? ;o)
Posted by :  Archive Import (Kapil Kumar Varshney) at 01:07 on Friday, August 22, 2003
Hi,
Can anyone guide me to disable all the elements (show the fields on the page as readonly) by javascript?
I want to make the page as readonly
Posted by :  Archive Import (M1K3 R0CK3T) at 11:10 on Friday, August 22, 2003
OK, I'm using this script in its simplest form. I have 2 checkboxes. The second is disabled until you click the first one.
That works fine.
But if you unclick the first checkbox, the second is still enabled.

Please Help!
Posted by :  Archive Import (jumbo) at 23:33 on Monday, September 08, 2003
no go in IE 6 .. tried many times
Posted by :  grace at 13:43 on Tuesday, February 03, 2004
Just want to ask how to enable and disable textbox if the record is dynamically generated.
The text box will become enable depending on the checked checkbox which is also dynamic.
Hope i can find the right code this time.
thanks in advance!
Posted by :  tdesai at 12:29 on Friday, August 13, 2004
I have a password field defined like

<input type="password" name="oldpassword" size="16">
Based on certain conditions, I need to enable it and
disable it

So I have a Javascript function wherein I am
coding the same as below

function some Func(..)
{
.....
if (condition) {
document.formname.oldpassword.disabled=true;
} else {
document.formname.oldpassword.disabled=false;
}
....
}

In Mozilla, it works the way I expected
meaning - the background color of the textfield
changes drastically enough to give the user the
impression that the field has been disabled

In IE (both 5.x and 6.0), the disabled doesn't allow
me to edit the password field but it does not dim/gray out
the password field to give the visual cue as to the fact
that this field has been disabled.

Any help/pointers would be very much appreciated..

thx
Tushar
Posted by :  Nusem at 07:49 on Monday, October 04, 2004
Notice That the code is writtem in JScript and that True and False are case sensitive,
in case you get run time error:
"variable 'True' is undefined"
Posted by :  Cyber at 01:15 on Wednesday, October 06, 2004
i wnat to know abt how to disable the submit button when the text box is empty can anyone send me the script i am new to this field

Posted by :  vishu_k26 at 03:48 on Tuesday, October 19, 2004
Hi,
Can anyone guide me to disable all the elements (show the fields on the page as readonly) by javascript?
I want to make the page as readonly

Urgent
Posted by :  casperjez at 23:36 on Thursday, October 21, 2004
Hi,

Does anyone have some code for changing the disabled fields text color? I want to change it from the greyed out color to something different. Can this even be done?

casp
Posted by :  aleksm at 00:36 on Monday, December 06, 2004
I am also playing with image buttons. But instead I want to enable the button until there is a change in one of you text elements.

So, this is what I have so far:

This should enable the image button

<script language="javascript">
function enablebutton(submitTypImage) {
submitTypImage.disabled = true;
}
</script>


The button simply has disabled="true" within the element tag

On my text element I have:

onChange=="enablebutton(this)"

I GET THIS ERROR: "UPDATEBUTTON IS UNDEFINED"

"UPDATEBUTTON" is the id and name of the image button.

What am I missing ?
Posted by :  vwebdev at 11:12 on Friday, March 11, 2005
Hello,

I found this article very helpfull and concise,
yet I have a forward question about accessing elements width "document" and "elements"
combination. I use aspx development platform supported by microsoft, does anyone use this platform and have accessed "hidden" elements ex. dropdown list whose visible property is set to false. I have tried to use document.getElementById("ElementName") methods but have failed to get reach of them. As far as I know the problem is that hidden elements are not accessible by javascript script which is located and executed at client side. Could anyone suggest how can I get values and index of selected element in hidden drop down list.

Any help is appreciated.

Regards

Simon
Posted by :  Intsik at 11:48 on Saturday, April 02, 2005
i have read this article and it is excellent. but with regards to this topic, i would like to seek solution to this problem.

i have two combo boxes in my form. the enabling and disabling of the second combobox depends on the value of the first combobox.
for example, i only want to enable my second combobox if the value of the first combobox is A or B..
Posted by :  sai_cool at 21:59 on Friday, April 15, 2005
i want to know how do i disable a 'back' button from the page which is present on the browser.plz can someone tell me the sol.
Posted by :  asif at 21:53 on Friday, April 29, 2005
I've put this line for disabling select box for validatin of form but it doesn't work, is there any body to helf me out

document.form1.selectbox.disabled = true;

cheers..
Posted by :  roders at 06:01 on Wednesday, June 29, 2005
Hi concerning the enabling field in form elements.
I would like to know if it exists 1 that would disabled certain field when the user select an option from a drop down list?

Thanks.
Posted by :  d32207 at 11:55 on Monday, September 19, 2005
Hi,
I would like to display a text box depending on if a checkbox was checked or not. When the checkbox is checked, I want the text box to appear. When it is unchecked, I want the text box to disappear.
Thanks in advance!
Posted by :  goldguy007 at 16:50 on Friday, September 23, 2005
i am using something similar to the code below to disable an image submit .
however, instead of going back to the page in process after hitting ok on the alert window (this is after the button has been hit a second time) it goes to a browser window with the word 'false' in it (from the return false; statement).

i just want the initial submission to continue. any clue why this is?????
thanks for the help

<script language="JavaScript">
var submitted=false;
function check_form() {
if (submitted == true) {
alert ("form already submitted") ;
[b]return false;[/b]
}
else {
submitted = true ;
[b]document.form.submit();[/b]
}
}
Posted by :  raj_fandoo at 00:31 on Monday, October 17, 2005
i have a form on which i am opening one popup window so that user can select data which are coming from database.

and after selection user is supposed to click on OK and i am refreshing the page with the help of window.opener(). now my problem is that the on click of OK on popup the page load of Parent page(base page) is getting called twice.


can some body please help me out on this. thanks in advance.

Posted by :  Kittyf01 at 14:42 on Tuesday, April 18, 2006
Hey everyone,

I am learning javscript and i figured this might be a good place to find out how to enable/disable a link. I am creating a Data CD, and I have a program on it that I use to view documents, but before I can view the documents I need to install this program. What I need to know is how can I tell a link to be disabled until this program is installed, and then enable its self once the program is installed. Would anyone be out there to give me a hand with this?

Thanks
Posted by :  Kausik at 11:30 on Sunday, June 11, 2006
I have been looking for this for sometime.Thank you.
Posted by :  nandanik2004 at 01:16 on Tuesday, June 13, 2006
sir,
I want to know how to disabled or enabled javascript through code? i.e. first of all i disable the java script from I.E or Mozila web browser, then i want to run my java script on that browser. Please inform me this is urgent.
My id is : nandanik2004@yahoo.com
nandanik2004@hotmail.com
in subject line u must refer "Java script disabled"
Bye
Posted by :  naveenbhojini at 23:51 on Monday, July 24, 2006
hai ,i am new to javascript. i know basics of javascript.i have problem that is .i want to disable the textboxes when i check one of the radio buttons .and when i check the other radio button the text boxes must be enabled.can u help me ?
Posted by :  picsee at 21:01 on Monday, August 21, 2006
Hello out there:

Can anyone tell me how to style a
text field based on its disable status?

This is the concept
disabled.true; //text field is styled to #999999
disabled.false; // text field is styled to #cccccc

I wrote this as a stab in the dark

<style>

#document.form1.Address1.disabled
{ background:#999999;}
</style>

I know this is not even close but I did read or hear something about CSS styling javascript.

I'd appreciate the help....

Thanks

Posted by :  Weird Al at 07:43 on Wednesday, September 20, 2006
Dear all

This article does not point out that there is extra when disabling/enabling radio buttons.

The usual manner of setting the disabled property is:

document.formname.fieldname.disabled=bool;

However, radio buttons are grouped by fieldname, meaning that several radio buttons have the same name. You would be forgiven for thinking that using the above syntax would disable all buttons of the same name, but you would be wrong. In fact, radio buttons create an array of that field name, so you have to do each one individually:

document.formname.radiobuttonname[0].disabled=bool;
document.formname.radiobuttonname[1].disabled=bool;

etc.

You may wish to use a for loop to go through them if you have a dynamically-created set of radio buttons.
Posted by :  anithacs10 at 06:01 on Wednesday, July 25, 2007
Dear all,

In this page i saw only the disabling part..

I am creating table using perl in a page. Basically I am disabling when i open the page. But i want to enable and edit the values when I click the checkbox.

How can I do this?

Please help me...
Other wise my boss will shoot out me..

Thank u all.
Posted by :  vikask at 05:22 on Wednesday, September 26, 2007
if u have this type of any problem pls visit to http://www.xpertteam.com
thx
Posted by :  sowsow at 03:28 on Friday, December 28, 2007
HI I WANT TO ENABLE A SELECT BOX ON CLICK OF A radio button...how ever i have to use html:select for the select box... and i have my select box and radio button in a logic:iterate tag... so when i click a particular radio button that particu;ar select box has to be enabled....

Please help me out with this...
Posted by :  GLube at 03:15 on Tuesday, April 08, 2008
Hi anithacs10!

Here's the code how to enable texbox by cliking checkbox. It will also disable textbox again if you tick-out the checkbox.

I hope I was'n too late and this was helpful.

<form1>
<input type="checkbox" name="enableOperator" value="done" onchange = "if(document.form1.operator.disabled==true) {javascript:document.form1.operator.disabled=false;} else {javascript:document.form1.operator.disabled=true;}" />

<input type="text" name="operator" value="Name of operator" disabled />
</form>
Posted by :  denrob at 10:18 on Sunday, June 29, 2008
Hi Everyone

I am all new to all this scripting, but was wondering if anyone knew of a way to disable ALL "copy" features as well as disabling ALL "print" features, (Inc. prnt scrn)

Honestly the number of people who "steal" things from the site is intollerable.

thanks to all

rob
Posted by :  unbehaun at 15:46 on Monday, July 28, 2008
I have experience doing basic websites, but I need help here.

I want to ask users to specify how they want to be contacted. Until they check a radio button, the phone, e-mail or postal address fields would be inaccessible and greyed out. Only when they check a radio button can they enter information. How do I do this?
Posted by :  tinyjcb at 11:51 on Tuesday, July 29, 2008
I have a field which is disabled/enabled depending on the value displayed in drop down menu.Once I choose a value,the textbox get disabled and the form is submitted.Then it goes to a confirmation page wher there is an option that either the user can go back to the previous page and modify his entries or submit further.But when the user tries to go back to the previous page by clicking 'BACK ' button given in the confirmation page ,the already disabled textbox get enabled.Can anyone please give me a solution?
Posted by :  vjsoni at 11:29 on Wednesday, August 27, 2008
Hi,

Is there a way i can change the color of a text field /prevent user to edit its value and at the same time retain the value that is entered on form submission.

What i had tried is i disabled that test field but the trouble is that on form submission the value of this field is coming as null.The idVal here is the object holding my text field value


[b]
if (idVal== null || idVal.trim().length() == 0) {
do smthing...
}[/b]
Posted by :  vjsoni at 11:30 on Wednesday, August 27, 2008
can smone please help me sort it out...its really urgent.
Posted by :  zenitharu at 06:23 on Monday, March 23, 2009
var obj=document.getElementById('checkbox1');
//for disable the control
if(obj.checked)
{
obj.disabled="disabled";
}
else //for enable make it to null like ''
{
obj.disabled='';
}

It works fine to me.

Regards
Aru
Posted by :  pavan168 at 21:41 on Monday, April 13, 2009
fg
Posted by :  pavan168 at 21:43 on Monday, April 13, 2009
Hey guys i need help on this.....well when i click on my button called "Start game" it shud enable the radio buttons...can any1 help me?.and i have some radio buttons as follows
<form name="questions"><p>
Question 1: WARM-UP: Who created the famous WarCraft 2?<br><br>
<input type="radio" name="q1" onClick="displayResult(1);" disabled="true">Sierra On-Line<br>
<input type="radio" name="q1" value="correct" onClick="displayResult('a'); " disabled="true">BlueByte<br>
<input type="radio" name="q1" onClick="displayResult(1);" disabled="true">Blizzard Entertainment<br>
<input type="radio" name="q1" onClick="displayResult(1);" disabled="true">Microsoft


To post comments you need to become a member. If you are already a member, please log in .

 



RELATED ARTICLES
Javascript - Enable and Disable form elements
by Jeff Anderson
This is a relatively little known and under-used feature of javascript which can be very useful in guiding a user through a form. Using the disabled tag, you can switch on and off elements in a form.
Check IsNumeric Function
by Jeff Anderson
A javascript validation function to check whether the details entered by a user are numeric.
Javascript Onload Event
by Jeff Anderson
Sometimes you need to perform an action immediatley after the page has loaded. That's when the onLoad Event Handler comes in handy
Form Validation Function
by Jeff Anderson
A javascript validation function that you can use to validate all types of forms.
JavaScript Field Is Empty Form Validation
by Jeff Anderson
This javascript function allows you to check whether a form field has been completed or not.
Javascript Get Selected Text
by Jeff Anderson
A cross-browser script to get text selected by the user
Check Email Validation Function
by Jeff Anderson
A javascript validation function to check whether the user has entered a valid email address in a form.
Multiple submit buttons on a single form
by Kiran Pai
This script shows you how to submit the contents of a form to different programs depending on which Submit button you press. Additionally it also shows how to call two different functions when you press the Submit button.
Validate Form and Disable Submit Button
by Marylou Marks
I have a form that validates info, but I also want to disable the submit button. The disable part worked before adding the form validating.
Javascript onUnload Event Handler
by Jeff Anderson
The onUnload Event Handler allows you to perform an action as the user leaves the page.








Recent Forum Threads
• Significant Factors
• Perl array access
• Re: huffman encoding and decoding in C++...
• Perl One Liner: Replace {(
• Re: html including php, accessing the functions
• Something like an INI editor or a DelimitedText-Editor
• Error Deleting File or Folder
• Re: How can use ASP.NET RegularExpressionValidator for alphanumeric 10 digit input
• Re: drop-down menu selected value


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2009