...

View Full Version : How can i get the value from this form?



pavelazad
01-08-2008, 06:27 AM
hello

i have a form which dynamically create another part of the form according to user requirement. but im facing problem to get the form field values. please help me to do it. my form is given below:

<html>

<head>

<title>title</title>

<meta content="">

<style></style>



<script language="javascript">





var counter = 0; // counter for naming the elements



function moreFields()

{

counter++;

var newFields = document.getElementById('readroot').cloneNode(true);

newFields.id = '';

newFields.style.display = 'block';

var newField = newFields.childNodes;

for (var i=0;i<newField.length;i++)

{

var theName = newField[i].name

if(theName)

{

newField[i].name = theName + counter;

newField[i].id = theName + counter;

}

}

var insertHere = document.getElementById('writeroot');

insertHere.parentNode.insertBefore(newFields,insertHere);

}



// -->

</script>



</head>

<body onload="moreFields()">



<div id="readroot" style="display: none">
<div align="center">Job Experience <br>
Company:
<input type="text" name="company" size="70">
<br>
Post :
<input type="text" name="post" size="70">
<br>
Job Duties:
<textarea name="duties" cols="60" rows="10"></textarea>
<input type="button" value="Remove" style="font-size: 10px" onClick="this.parentNode.parentNode.removeChild(this.parentNode);">
</div>
</div>



<form method=post>



<span id="writeroot"></span>

<p class="hr">&nbsp;</p>



<input type="button" value="Add New Line" onClick="moreFields()"><br>

<input type="submit" value="Send form">



</form>





</body>

</html>

abduraooft
01-08-2008, 08:39 AM
How to get value from this form? (http://www.codingforums.com/showthread.php?t=130859) Your previous post may help!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum