2

I am using modalpopup to enter some value in a textfield. After the value is selected in the modalpopup view, the modalpopup is closed and the value takes the appropriate value. Even if the value is displayed in the textfield, the textfield1.text returns an empty string. When I see the source code (html), I see that even the textfield isn't displaying anything; it hasn't really had this value input, because the appropriate html input field hasn't got a value yet.

This is the code I use to fill this textfield:

function CloseRequestModal(s)
    {
        document.getElementById('<%=txtRequest.ClientID%>').value = s;

        var mpu = $find('<%=ModalPopupExtender3.ClientID%>');
        mpu.hide();
    }

Please help.

Gaffi
  • 4,307
  • 8
  • 43
  • 73
Florjon
  • 3,569
  • 3
  • 22
  • 29

2 Answers2

0

I would need to see source HTML cause it looks like you have template language mixed into your javascript but perhaps instead of "textfield1.text" you use "textfield1.value"?

Additionally, you would need to view "generated" source (with a browser plugin) or inspect the node with web inspector on safari/chrome or firebug on firefox in order to see the change that you made with javascript.

Auston
  • 480
  • 1
  • 6
  • 13
  • textfield1.value does not exist in server side. i have seen the generated source, and i see that the value of the input textfield doesn't have any value, even if it displays something. – Florjon Jun 12 '10 at 10:05
0

i fixed this problem in an alternate way.

even if the value is there (in the textfield), none of the events is fired, to let know the browser / compilator that the value really exists.

so i decided, despite editing the value of the textfield, i store this value in the session too. in this case, the value is displayed for user needed in the interface, and on the other hand i use the value that i stored in the session.

Florjon
  • 3,569
  • 3
  • 22
  • 29