hi all,
got an interesting problem:
im working with purchase orders and in detail line i have a date field.
so for example:
header line:
PO code: X123
PO value: 100
po date: 05/05/2004
detail lines:
line no.: 1
delivery date: 10/10/2004
value: 40
line no.: 2
delivery date:
value: 60
i want to update a date in a detail record by placing the value from
javascript calendar app into a hidden field...
so all i do is (asp side):
<form...
<input type="text" name="whatever" value='<%=somedate%>'>
<a href="javascript:show_calendar('document.inv.whate ver',
document.inv.whatever.value);">
....form>
& that all works fine.
the problem arises if i want to use the app in a detail section
if a place the code against a line for detail then i have two text boxes
with the same name so the javascript does not work...
also if i do something like:
<input type="text" name="<%=counter%>" value='<%=rsc("invdat")%>'>
<a href="javascript:show_calendar('document.inv.<%=co unter%>',
document.inv.<%=counter%>.value);">
the code although it looks ok (when i do the View>source code in IE)
does not work.
the only crazy solution is to :
<%select case counter
case 1%>
<td>
<input type="text" name="a"
value='<%=rsc("invddatr")%>'>
<img src="pics/cal.gif"
href="javascript:show_calendar('document.invdetdet .a',
document.invdetdet.a.value);" alt="Date"></a>
</td>
<%case 2%>
<td>
<input type="text" name="b"
value='<%=rsc("invddatr")%>'>
<a src="pics/cal.gif"
href="javascript:show_calendar('document.invdetdet .b',
document.invdetdet.b.value);" alt="Date"></a>
</td>
....
....end select%>
but that is just stupid writing a possible line for every number of
counter!!!
is there a better way to do this?
regards
mi