Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. how to update elements in modal popup by using java script

how to update elements in modal popup by using java script

Scheduled Pinned Locked Moved ASP.NET
javajavascriptcsstoolshelp
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    Zapss
    wrote on last edited by
    #1

    hi am new to ajax,am facing a big problem, my requirement is to add the item details to the grid,by using modal popup. In the modal popup i give a option to search the itemname this search details will be shown on grid in the same modal popup,in that grid i added button for selecting rows. once the user click the select button, i want to assign the values in the modal popup textbox, by using java script fucntion. My problem is javascript fucntion working well, i tried by alert fucnction working fine but the function shopModalPopup(itmid,itmno,itmdesc,onhand){ ********** working ************* alert(itmid); alert(itmno); alert(itmdesc); ********** not working ************* document.getElementById('itemid').value=itemid; document.getElementById('itemno').value=itmno; document.getElementById('itmdesc').value=itmdesc; document.getElementById('onhand').value=onhand; ********** not working ************* $get("<%=this.itemid.ClientID %>").value = itemid; $get("<%=this.itemno.ClientID %>").value =itmno; $get("<%=this.itemdesc.ClientID %>").value =itmno; $get("<%=this.onhand.ClientID %>").value =onhand; }

    C A 2 Replies Last reply
    0
    • Z Zapss

      hi am new to ajax,am facing a big problem, my requirement is to add the item details to the grid,by using modal popup. In the modal popup i give a option to search the itemname this search details will be shown on grid in the same modal popup,in that grid i added button for selecting rows. once the user click the select button, i want to assign the values in the modal popup textbox, by using java script fucntion. My problem is javascript fucntion working well, i tried by alert fucnction working fine but the function shopModalPopup(itmid,itmno,itmdesc,onhand){ ********** working ************* alert(itmid); alert(itmno); alert(itmdesc); ********** not working ************* document.getElementById('itemid').value=itemid; document.getElementById('itemno').value=itmno; document.getElementById('itmdesc').value=itmdesc; document.getElementById('onhand').value=onhand; ********** not working ************* $get("<%=this.itemid.ClientID %>").value = itemid; $get("<%=this.itemno.ClientID %>").value =itmno; $get("<%=this.itemdesc.ClientID %>").value =itmno; $get("<%=this.onhand.ClientID %>").value =onhand; }

      C Offline
      C Offline
      compninja25
      wrote on last edited by
      #2

      does it work if you use innerHTML? document.getElementById('<%=this.itemid.ClientID%>').innerHTML = itemid;

      Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.

      Z 2 Replies Last reply
      0
      • Z Zapss

        hi am new to ajax,am facing a big problem, my requirement is to add the item details to the grid,by using modal popup. In the modal popup i give a option to search the itemname this search details will be shown on grid in the same modal popup,in that grid i added button for selecting rows. once the user click the select button, i want to assign the values in the modal popup textbox, by using java script fucntion. My problem is javascript fucntion working well, i tried by alert fucnction working fine but the function shopModalPopup(itmid,itmno,itmdesc,onhand){ ********** working ************* alert(itmid); alert(itmno); alert(itmdesc); ********** not working ************* document.getElementById('itemid').value=itemid; document.getElementById('itemno').value=itmno; document.getElementById('itmdesc').value=itmdesc; document.getElementById('onhand').value=onhand; ********** not working ************* $get("<%=this.itemid.ClientID %>").value = itemid; $get("<%=this.itemno.ClientID %>").value =itmno; $get("<%=this.itemdesc.ClientID %>").value =itmno; $get("<%=this.onhand.ClientID %>").value =onhand; }

        A Offline
        A Offline
        Abhishek Sur
        wrote on last edited by
        #3

        have you used document.getElementById('<%=this.itemid.ClientID %>').value = itemid; Also check what browser renders. If it is input, you can use value, if its container you use innerHTML.. :cool:

        Abhishek Sur


        My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

        **Don't forget to click "Good Answer" if you like to.

        1 Reply Last reply
        0
        • C compninja25

          does it work if you use innerHTML? document.getElementById('<%=this.itemid.ClientID%>').innerHTML = itemid;

          Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.

          Z Offline
          Z Offline
          Zapss
          wrote on last edited by
          #4

          Thanks for your reply i tried your code document.getElementById('<%=this.itemno.ClientID%>').innerHTML = itmno; but still the value is not visible in textbox. view soruce look like this <td> <input name="itemno" id="itemno" style="height: 21px; width: 263px;" type="text"><input>E-4005 "E-4005" is my itemno it is not visible in textbox.

          1 Reply Last reply
          0
          • C compninja25

            does it work if you use innerHTML? document.getElementById('<%=this.itemid.ClientID%>').innerHTML = itemid;

            Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.

            Z Offline
            Z Offline
            Zapss
            wrote on last edited by
            #5

            Thanks it works document.getElementById('<%=itemdesc.ClientID %>').value

            C 1 Reply Last reply
            0
            • Z Zapss

              Thanks it works document.getElementById('<%=itemdesc.ClientID %>').value

              C Offline
              C Offline
              compninja25
              wrote on last edited by
              #6

              Hey Zapss, Great! I probably skimmed through the question too quickly, but I wasn't sure what type of control you were using. I just remember having an asp:label control one time and the .value would not change! I then stumbled across an article where someone mentioned that the label is putting a "" tag on the html and you need to use innerHTML to change what is displayed.

              Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups