File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 agree. Here's the link:
subject: Newbie need help with textfield value.
It's not a secret anymore!