WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Mobile Dev World

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Changing the Style of form objects using the JavaScript OnClick method.
Categories : Java Script, Form Processing, Beginner Guides, CSS Click here to Update Your Picture
Rupali Gulande
Date : Jul 13th 2007
Grade : 3 of 5 (graded 3 times)
Viewed : 10282
File : 4675.zip
Images : Image 1
Search : More code by Rupali Gulande
Action : Grade This Code Example
Tools : My Examples List

  Submit your own code examples 
 

In this example we are going to Change CSS of Form on Button Click event.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Changing Text and Background color on button Click</title>
<script language="javascript" type="text/javascript">
var toggle=false;
function doIt()
{
  if(toggle)
  {
    document.exf1.t1.style.color="green";
    document.exf1.t1.style.backgroundColor="orange";
  }
  else
  {
    document.exf1.t1.style.color="#000440";
    document.exf1.t1.style.backgroundColor="#d0d0d0";
  }
  document.exf1.toggle.value=toggle=!toggle;
}
</script>

</head>

<body>
<form name="exf1">
<input style="color:#000440;background-color:#d0d0d0;" type="text" name="t1" value="text value" />
<br />
<input type="text" readonly="readonly" value="false" name="toggle" />
<br />
<input type="button" name="b1" value="Click Me" onclick="doIt()" />
<br />
</form>
</body>
</html>



JavaScript dropdown list menu to switch any page.
Categories : Java Script, Beginner Guides, Form Processing
Show hide table rows to make dynamic forms
Categories : Beginner Guides, Java Script, Form Processing, HTTP
Form Processing : with alert Highlight field name which is not filled by user
Categories : Java Script, Form Processing, Data Validation, Beginner Guides, Web Design
Simple Javascript CSS Digital Clock
Categories : Java Script, Date Time, CSS, Beginner Guides, Web Design
Show or Hide your Content using Javascript
Categories : Java Script, HTML, CSS, Beginner Guides
Hilight Form Element onFocus
Categories : Java Script, Form Processing, CSS
Conditional Check - a script that allows a user to submit a form only if the user check a checkbox.
Categories : HTML, Java Script, Form Processing, Beginner Guides
PHP and javascript mouseover, mouseout, and mousedown events
Categories : PHP, Java Script, Form Processing, Beginner Guides
Upload any fixed type of files, control file type through javascript and encrypt filename using php so file not get overwrite
Categories : PHP, Java Script, Functions, PHP References, Form Processing
PHP Calendar
Categories : PHP, Calendar, Date Time, Java Script, CSS
Balance values between two list boxes. Change the value of list box A acording to the value in list box B and vice versa using Javasvript.
Categories : Java Script, Form Processing
CSS Buttons Styles
Categories : CSS, HTML, Beginner Guides
Javascript animated menu items
Categories : DHTML, CSS, Java Script, HTML
Local Time clock and Server time usign PHP and JavaScript
Categories : PHP, Java Script, Date Time, Beginner Guides
Page Loading Message shown during the time your site's page is being loaded.
Categories : HTML, CSS, Java Script