This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt 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


Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Newbie need help with textfield value." Watch "Newbie need help with textfield value." New topic
Author

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;

alert(nForm['daysApart'].value);

return true;
}

</script>

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

alert(nForm['daysApart'].value);
Pavan Keely
Ranch Hand

Joined: Jun 30, 2006
Posts: 62
vanan,

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

Pavan Keely


Pavan Keely<br /><a href="http://keelypavan.blogspot.com" target="_blank" rel="nofollow">http://keelypavan.blogspot.com</a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Newbie need help with textfield value.
 
It's not a secret anymore!