Skip to main content
Inspiring
October 29, 2006
Question

ASP - Can't change the correct hidden field in loop.

  • October 29, 2006
  • 12 replies
  • 600 views
I have a table with a repeating region in ASP. In the table there are a
dropdown menu and a hiddenfield (amongst other items). I have a javascript
function that is applied to the onChange event of the dropdown menu. The
function updates the value of the hidden field to 'Y' when the dropdown
changes. The default value is 'N'.

The problem I have is that I cannot get the correct hidden field in the
repeat region to update. It always updates the hidden field in the very
first row of the repeated table even though I am changing the dropdown that
is in row no.3 for example. I know that the this is happening as I currently
have the hidded fields set to display as textfields.

Could somebody please show me how I can get the correct hidden field in the
row that holds the changed dropdown to update please.


This topic has been closed for replies.

12 replies

Inspiring
October 30, 2006
Hi Lionstone,

No, all the formfields on the form are named differently and each hidden
field (the ones in which the value can change) are named independently by
taking their value from the loop count. The behaviour will be activated
after the table is generated - when the user clicks on a dropdown in a
specific row.

I am almost sure that this is a naming problem though. I know how to name
the hidden field differently with each loop when the table is generated but
when the javascript function is called it will only see the hidden field in
the very first row of the table I do not know a method of how I can get the
HF that is in the same row as the dropdown that is accessed to change.


"Lionstone" <HIDElionstone@HIDEhushmail.com> wrote in message
news:ei51hm$3s7$1@forums.macromedia.com...
> Sounds like all your form fields have the same name, or the behavior in
> your onChange event is not changing field names with everything else.
>
>
> "SteveG" <ssdfsd@sdfsd.com> wrote in message
> news:ei2l81$a5r$1@forums.macromedia.com...
>>I have a table with a repeating region in ASP. In the table there are a
>>dropdown menu and a hiddenfield (amongst other items). I have a javascript
>>function that is applied to the onChange event of the dropdown menu. The
>>function updates the value of the hidden field to 'Y' when the dropdown
>>changes. The default value is 'N'.
>>
>> The problem I have is that I cannot get the correct hidden field in the
>> repeat region to update. It always updates the hidden field in the very
>> first row of the repeated table even though I am changing the dropdown
>> that is in row no.3 for example. I know that the this is happening as I
>> currently have the hidded fields set to display as textfields.
>>
>> Could somebody please show me how I can get the correct hidden field in
>> the row that holds the changed dropdown to update please.
>>
>
>


Inspiring
October 30, 2006
Sounds like all your form fields have the same name, or the behavior in your
onChange event is not changing field names with everything else.


"SteveG" <ssdfsd@sdfsd.com> wrote in message
news:ei2l81$a5r$1@forums.macromedia.com...
>I have a table with a repeating region in ASP. In the table there are a
>dropdown menu and a hiddenfield (amongst other items). I have a javascript
>function that is applied to the onChange event of the dropdown menu. The
>function updates the value of the hidden field to 'Y' when the dropdown
>changes. The default value is 'N'.
>
> The problem I have is that I cannot get the correct hidden field in the
> repeat region to update. It always updates the hidden field in the very
> first row of the repeated table even though I am changing the dropdown
> that is in row no.3 for example. I know that the this is happening as I
> currently have the hidded fields set to display as textfields.
>
> Could somebody please show me how I can get the correct hidden field in
> the row that holds the changed dropdown to update please.
>