Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hidden field needs updating 1

Status
Not open for further replies.

Rob7412

Technical User
Jan 26, 2006
31
US
The ASP guys told me to come here for a solution.

I have a hidden field called filecondition
I also have 2 text fields on on the page called startdate and enddate.

I need the user to input a start date and a end date into the boxes and when they do I need to update the hidden field value before I submit.
For Example:
The user inputs 01/01/05 in startDate text field
User inputs 12/31/05 in the end date field I would need the filecondition hidden value updated to the example below before the user submits the form.

<input name="filecondition" type="hidden" id="filecondition" value="xfilter(created "01/01/05~~12/31/05")" />

Thanks for any help you can give.
By the way I know Diddley about Javascript.....

 
Try something like this:
Code:
<script type="text/javascript">
function updatefilecondition()
{
var el = document.forms['yourformnamehere'].elements;
var startdate = el['startDate'].value;
var enddate = el['endDate'].value;

el['filecondition'].value = 'xfilter(created "' + startdate + '~~' + enddate + '")';

}
</script>


<form name="yourformnamehere" onsubmit="updatefilecondition();">

Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top