And also here's another way to work around it:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<title>Free Live Help!</title>
<script type="text/javascript">
<!--
var domEntry = function() {
var ie = 1;
var form;
var input;
var label;
var div = document.getElementById("main"); // will served as the place holder of the created elements ( form/input ).
(( !div && ( ie = document.all.main )) ? div = ie : ie = 0 );
/*
- If the browser does understand the
getElementById method,
then variable ( div ) will
preserved its first declared
value, otherwise it will be
set to hold the document.all
method, which is best
supported in all modes of IE browsers.
*/
if ( "createElement" in document ) { // Check if it does support the createElement in the document. continue >>>
/* OPTIONAL ATTRIBUTES */
form = document.createElement("form"); // Form Object
form.action = String( "http://yourDomain/process/fieldentries" ); // You must replace this with a valid action URL.
form.id = "form1"; // Specify the form id.
form.method = "post"; // Specify which method to be used upon form submission, it's eithe get/post.
label = document.createElement("label"); // Creating label tag.
textLabel = document.createTextNode("Dynamic Field: "); // Creating textual display for the label tag.
input = document.createElement("input"); // Input Element
input.type = "text"; // Specify which type of input element will be used before injection.
input.id = "text1"; // Specify its id.
input.name = "text1"; // Specify its name.
input.value = ""; // Specify its value.
input.size = 30; // Specify its width;
if ( ie ) { // Best method when injecting ELEMENT in IE Mode.
label.insertAdjacentElement( "afterBEGIN", input );
label.insertAdjacentText( "afterBEGIN", "Dynamic Field:" );
form.insertAdjacentElement( "beforeEND", label );
div.insertAdjacentElement( "beforeEND", form );
return;
} label.appendChild( textLabel );
label.appendChild( input );
form.appendChild( label );
div.appendChild( form );
return;
} alert("Please update your browser with its latest patch.", "unsupported feature");
return false;
};
onload = domEntry;
// -->
</script>
</head>
<body>
<div id="main"></div>
</body>
</html>
Bookmarks