CoderZone.org

Category: >> JavaScript >> Add a hidden field to a form dynamically Bookmark and Share

<< lastnext >>

Snippet Name: Add a hidden field to a form dynamically

Description: This function adds a hidden form field to a specified form on the fly. Call the function with the name of the form, the name of the hidden field to be added, and the value the field should contain.

Also see:
» Add more fields to a form dynamica...
» Javascript Include - allows dynami...
» Add and Remove classes in Javascri...
» Easy way to break apart an email a...
» Check for a Valid Email Address (V...
» Check For A Valid Email Address
» Rounding numerical fields
» Dynamically create HTML elements
» Add PSOUG Search to SQL Developer
» Read GET URL Variables Into An Ass...
» Dynamically add and remove elements
» Search and Replace On Every Field ...
» Add a period at the end of a strin...
» Dynamically Add/Remove rows in HTM...
» Check email address
» Date Functions: ADD_MONTHS
» Date Functions: Add and Subtract f...
» GET and POST variables in hidden f...
» Add dashes to credit card numbers
» Select based on a field that can h...
» Get last added insert ID
» Update/convert DB field to upperca...
» Add and Subtract dates
» Add string to field
» Move position of mySQL field
» Add or Subtract days
» Add random numbers to columns
» Add new user
» Date Functions: Add Months

Comment: (none)

Author:
Language: JAVASCRIPT
Highlight Mode: JAVASCRIPT
Last Modified: April 10th, 2011

function addHiddenField(formName, fieldName, fieldValue){
	   var el = document.createElement("input");
	   el.type = "hidden";
	   el.name = formName;
	   el.value = fieldValue;
	   formName.appendChild(el);
}
 
There haven't been any comments added for this snippet yet. You may add one if you like.  Add a comment 
© coderzone.org | users online: 3