Click to See Complete Forum and Search --> : onChange event to alter hidden value
creativetech
04-15-2003, 01:41 PM
This is probably a simple one, but I am lost...
it is related to one I asked about yesterday. I have an ASP page that dynamically writes out several rows of data per page, max 10 per page. Within each of the 10 rows is a <select> field containing names. I also have a hidden field within each row of data which is set to a default value of 1. I would like to change that hidden value to 0 when the user selects a name from the <select> field, but only for the row selected, not for all the hidden values on the page.
Sounds simple, but because the rows are written out dynamically by asp, each <select> field has the same name, as do all the hidden values...Right now it is not altering the hidden values when I change the value of the <select> field.
Any help would be greatly appreciated.
Thanks
khalidali63
04-15-2003, 02:18 PM
post sample HTM code that is roduced by ASP including select boxes and hidden fields.
Cheers
Khalid
creativetech
04-15-2003, 02:30 PM
here it is...sorry it's kind of a lot...
Basically, the user selects a name from the dropdown <select> field called "assign" and I am trying to get that onChange event to alter the hidden field "recycleval" from 1 to 0, but only for the actual row the user is changing, not all the hidden values. Kind of the opposite of what I was doing yesterday.
Thanks!
<form name="callassign" action="../../../includes/assignleadsproc.asp?page=1024&mode=recycle" method="post">
<tr>
<td width="100%" height="4">
</td>
</tr>
</table>
<div align="center">
<center>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" height="20" colspan="4"></td>
</tr>
<tr>
<td width="100%" colspan="3"><p align="left" style="margin-left: 7"></td></tr>
<p align="left">Page <B>1</B> of <B>1</B><BR>
<tr>
<td height="21" bgcolor="#F4F4EA" style="border-top: 1px solid #4066B3; border-left: 1px solid #4066B3; border-bottom: 1px solid #CCCCCC"><p align="left" style="margin-left: 3"><b>Lead ID: <a href="viewleaddetail.asp?ID=30&Agency=1">30</a></b></td>
<input type="hidden" Name="leadID" Value="30"><td height="21" bgcolor="#F4F4EA" style="border-top: 1px solid #4066B3; border-bottom: 1px solid #CCCCCC"><p align="left"><b>Lead type:</b> Respcentre.ca</td>
<td height="21" bgcolor="#F4F4EA" style="border-right: 1px solid #4066B3; border-top: 1px solid #4066B3; border-bottom: 1px solid #CCCCCC"><p align="left" style="margin-left: 6"><b>Date entered:</b> 3/30/2003 6:38:00 PM</td>
</tr>
<tr>
<td height="21" colspan="2" bgcolor="#F4F4EA" style="border-left: 1px solid #4066B3"><p align="left" style="margin-left: 2"><b>Lead's name:</b> Paul Taylor</td>
<td height="21" bgcolor="#F4F4EA" style="border-right: 1px solid #4066B3"><p align="left" style="margin-left: 6"><b>Entered by:</b> Ethan Hawke</td>
</tr>
<tr>
<td height="21" bgcolor="#F4F4EA" style="border-left: 1px solid #4066B3"><p align="left" style="margin-left: 2"><p align="left" style="margin-left: 3"><b>Number of calls made:</b> 2</td>
<td height="21" bgcolor="#F4F4EA"></td>
<td height="21" bgcolor="#F4F4EA"><p align="left" style="margin-left: 6"><b>Call results:</b>
</td>
</tr>
<tr>
<td height="21" bgcolor="#F4F4EA" style="border-left: 1px solid #4066B3"><p align="left" style="margin-left: 3"><b>City:</b> Burnaby</td>
<td height="21" bgcolor="#F4F4EA"><p align="left"><b>Province:</b> British Columbia</td>
<td height="21" bgcolor="#F4F4EA" style="border-right: 1px solid #4066B3"><p align="left" style="margin-left: 6"><b>H. Phone:</b> 666-3455</td>
</tr>
<tr>
<td height="23" bgcolor="#F4F4EA" style="border-left: 1px solid #4066B3; border-bottom: 1px solid #4066B3"><p align="left" style="margin-left: 3"><b>Re-assign this lead to:</b></td>
<td height="23" colspan="3" bgcolor="#F4F4EA" style="border-bottom: 1px solid #4066B3"><p align="left"><select size="1" class="dropdown" name="assign">
<option value="">Do not assign</option>
<option value="21">ksmith</option>
<option value="22">ehawke</option>
<option value="30">PeteB</option>
</select></td></tr>
</td></tr>
<input type="hidden" name="recycleval" value="1">
<tr>
<td height="15" colspan="4"></td>
</tr>
<tr>
<td height="21" bgcolor="#F4F4EA" style="border-top: 1px solid #4066B3; border-left: 1px solid #4066B3; border-bottom: 1px solid #CCCCCC"><p align="left" style="margin-left: 3"><b>Lead ID: <a href="viewleaddetail.asp?ID=33&Agency=1">33</a></b></td>
<input type="hidden" Name="leadID" Value="33"><td height="21" bgcolor="#F4F4EA" style="border-top: 1px solid #4066B3; border-bottom: 1px solid #CCCCCC"><p align="left"><b>Lead type:</b> Boy or Girl</td>
<td height="21" bgcolor="#F4F4EA" style="border-right: 1px solid #4066B3; border-top: 1px solid #4066B3; border-bottom: 1px solid #CCCCCC"><p align="left" style="margin-left: 6"><b>Date entered:</b> 4/2/2003 9:41:00 PM</td>
</tr>
<tr>
<td height="21" colspan="2" bgcolor="#F4F4EA" style="border-left: 1px solid #4066B3"><p align="left" style="margin-left: 2"><b>Lead's name:</b> Peter Beeswax</td>
<td height="21" bgcolor="#F4F4EA" style="border-right: 1px solid #4066B3"><p align="left" style="margin-left: 6"><b>Entered by:</b> Ethan Hawke</td>
</tr>
<tr>
<td height="21" bgcolor="#F4F4EA" style="border-left: 1px solid #4066B3"><p align="left" style="margin-left: 2"><p align="left" style="margin-left: 3"><b>Number of calls made:</b> 2</td>
<td height="21" bgcolor="#F4F4EA"></td>
<td height="21" bgcolor="#F4F4EA"><p align="left" style="margin-left: 6"><b>Call results:</b>
</td>
</tr>
<tr>
<td height="21" bgcolor="#F4F4EA" style="border-left: 1px solid #4066B3"><p align="left" style="margin-left: 3"><b>City:</b> Burnaby</td>
<td height="21" bgcolor="#F4F4EA"><p align="left"><b>Province:</b> British Columbia</td>
<td height="21" bgcolor="#F4F4EA" style="border-right: 1px solid #4066B3"><p align="left" style="margin-left: 6"><b>H. Phone:</b> 555-1212</td>
</tr>
<tr>
<td height="23" bgcolor="#F4F4EA" style="border-left: 1px solid #4066B3; border-bottom: 1px solid #4066B3"><p align="left" style="margin-left: 3"><b>Re-assign this lead to:</b></td>
<td height="23" colspan="3" bgcolor="#F4F4EA" style="border-bottom: 1px solid #4066B3"><p align="left"><select size="1" class="dropdown" name="assign">
<option value="">Do not assign</option>
<option value="21">ksmith</option>
<option value="22">ehawke</option>
<option value="30">PeteB</option>
</select></td></tr>
</td></tr>
<input type="hidden" name="recycleval" value="1">
<tr>
<td height="15" colspan="4"></td>
</tr>
<tr>
<td height="21" bgcolor="#F4F4EA" style="border-top: 1px solid #4066B3; border-left: 1px solid #4066B3; border-bottom: 1px solid #CCCCCC"><p align="left" style="margin-left: 3"><b>Lead ID: <a href="viewleaddetail.asp?ID=5976&Agency=1">5976</a></b></td>
<input type="hidden" Name="leadID" Value="5976"><td height="21" bgcolor="#F4F4EA" style="border-top: 1px solid #4066B3; border-bottom: 1px solid #CCCCCC"><p align="left"><b>Lead type:</b> Other agency trades</td>
<td height="21" bgcolor="#F4F4EA" style="border-right: 1px solid #4066B3; border-top: 1px solid #4066B3; border-bottom: 1px solid #CCCCCC"><p align="left" style="margin-left: 6"><b>Date entered:</b> 4/3/2003 12:45:00 AM</td>
</tr>
<tr>
<td height="21" colspan="2" bgcolor="#F4F4EA" style="border-left: 1px solid #4066B3"><p align="left" style="margin-left: 2"><b>Lead's name:</b> KIMBERLY ECKERT</td>
<td height="21" bgcolor="#F4F4EA" style="border-right: 1px solid #4066B3"><p align="left" style="margin-left: 6"><b>Entered by:</b> Ethan Hawke</td>
</tr>
<tr>
<td height="21" bgcolor="#F4F4EA" style="border-left: 1px solid #4066B3"><p align="left" style="margin-left: 2"><p align="left" style="margin-left: 3"><b>Number of calls made:</b> 2</td>
<td height="21" bgcolor="#F4F4EA"></td>
<td height="21" bgcolor="#F4F4EA"><p align="left" style="margin-left: 6"><b>Call results:</b>
</td>
</tr>
<tr>
<td height="21" bgcolor="#F4F4EA" style="border-left: 1px solid #4066B3"><p align="left" style="margin-left: 3"><b>City:</b> NORTH VANCOUVER</td>
<td height="21" bgcolor="#F4F4EA"><p align="left"><b>Province:</b> British Columbia</td>
<td height="21" bgcolor="#F4F4EA" style="border-right: 1px solid #4066B3"><p align="left" style="margin-left: 6"><b>H. Phone:</b> 604-9043462</td>
</tr>
<tr>
<td height="23" bgcolor="#F4F4EA" style="border-left: 1px solid #4066B3; border-bottom: 1px solid #4066B3"><p align="left" style="margin-left: 3"><b>Re-assign this lead to:</b></td>
<td height="23" colspan="3" bgcolor="#F4F4EA" style="border-bottom: 1px solid #4066B3"><p align="left"><select size="1" class="dropdown" name="assign">
<option value="">Do not assign</option>
<option value="21">ksmith</option>
<option value="22">ehawke</option>
<option value="30">PeteB</option>
</select></td></tr>
</td></tr>
<input type="hidden" name="recycleval" value="1">
<tr>
<td height="15" colspan="4"></td>
</tr>
</tr>
<tr>
<td width="100%" colspan="3" height="22">
<center>
<input type="image" src="../../../images/savebutton.gif" border="0" alt="Click here to save these assignments">
</center>
</td>
</form>
khalidali63
04-15-2003, 03:12 PM
Here you go.You will have to validate it against your scenarios.Its working from where I see it..
:D
http://68.145.35.86/temp/FormProblem-creativetech.html
Cheers
khalid
creativetech
04-15-2003, 03:40 PM
It works great!
I can now pass the hidden values to the stored procedure and it works!
Thanks a lot! :)
khalidali63
04-15-2003, 03:45 PM
You are welcome...:p
Khalid