This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Newbie need help with textfield value. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Newbie need help with textfield value." Watch "Newbie need help with textfield value." New topic

Newbie need help with textfield value.

vanan saravanan
Ranch Hand

Joined: Jun 02, 2006
Posts: 95
Hi, i have the following script.

<script type="text/javascript">

function checkDate(nForm){

var sDate = nForm['dc1'].value;
sDate = sDate.split('-');
sDate = new Date(sDate[2],sDate[1]-1,sDate[0])
var eDate = nForm['dc2'].value;
eDate = eDate.split('-');
eDate = new Date(eDate[2],eDate[1]-1,eDate[0])
nForm['daysApart'].value = (eDate-sDate)/86400000;


return true;


How do i put the below value into a hidden text field.

Pavan Keely
Ranch Hand

Joined: Jun 30, 2006
Posts: 62

Use nForm.hiddenFieldName.value = nForm['daysApart'].value;

Pavan Keely

Pavan Keely<br /><a href="" target="_blank" rel="nofollow"></a>
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Newbie need help with textfield value.
It's not a secret anymore!