extracting values from a dynamically created row

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cygsoft
    New Member
    • Jun 2007
    • 29

    #1

    extracting values from a dynamically created row

    Hi

    I have created a dynamic row and inserted the values into the cells of those rows from textboxes. Now I have to edit those values stored in the rows. At the end of each row created dynamically two buttons namely "Edit" and "Delete" are present. If I click the "Edit" button the values in that particular cells should go back to the textboxes for editing and then after editing it should go to the corresponding place.

    Can any one help to solve this using Javascript.
    Thanks in Advance........ .
  • cygsoft
    New Member
    • Jun 2007
    • 29

    #2
    redirecting the value from one page to another

    Hi

    I have created the table using an email id. The end of each row contains "Edit" and "Delete" options. If I click Edit Button of that particular row, The emailid should be transferred to other page for editing and then return back after modification to the previous page.

    Thanks.
    It would be so helpful for me.

    Comment

    • r035198x
      MVP
      • Sep 2006
      • 13225

      #3
      Originally posted by cygsoft
      Hi

      I have created the table using an email id. The end of each row contains "Edit" and "Delete" options. If I click Edit Button of that particular row, The emailid should be transferred to other page for editing and then return back after modification to the previous page.

      Thanks.
      It would be so helpful for me.
      1.) Are you using JSP?
      2.) Do you have each edit link in its own form? You can pass the email value as a hidden field of that form.

      Comment

      • cygsoft
        New Member
        • Jun 2007
        • 29

        #4
        thanks for ur reply

        I am creating a row dynamically in that email address, edit and delete buttons are there. For each row created dynamically the corresponding edit and delete buttons are also created.

        If i click an edit button in a particular row the emailid in tht row should be extracted for modification.

        Comment

        • r035198x
          MVP
          • Sep 2006
          • 13225

          #5
          Originally posted by cygsoft
          thanks for ur reply

          I am creating a row dynamically in that email address, edit and delete buttons are there. For each row created dynamically the corresponding edit and delete buttons are also created.

          If i click an edit button in a particular row the emailid in tht row should be extracted for modification.
          You'll still need to tell us if you're using JSP or just Javascript.
          How does the submiting work by clicking the edit button? You need a form to submit. Once you answer my initial questions, everything will become clear from then on.

          Comment

          • cygsoft
            New Member
            • Jun 2007
            • 29

            #6
            Originally posted by r035198x
            You'll still need to tell us if you're using JSP or just Javascript.
            How does the submiting work by clicking the edit button? You need a form to submit. Once you answer my initial questions, everything will become clear from then on.

            It was in Javascript. "Edit" is not a submit button. It is generated dynamically when each new EmaiiId is added. Now when "Edit" is clicked the email ID should be brought for editing.

            For each mailID added there is a corresponding "Edit" and "Delete" is present.
            If any Edit or Delete of a particular row is clicked then the that row should be brought for modification. After modification the mailID should be send back to the same place.

            Comment

            • r035198x
              MVP
              • Sep 2006
              • 13225

              #7
              Originally posted by cygsoft
              It was in Javascript. "Edit" is not a submit button. It is generated dynamically when each new EmaiiId is added. Now when "Edit" is clicked the email ID should be brought for editing.

              For each mailID added there is a corresponding "Edit" and "Delete" is present.
              If any Edit or Delete of a particular row is clicked then the that row should be brought for modification. After modification the mailID should be send back to the same place.
              Then the question belongs in the Javascript forum and so I'll move it there.

              Comment

              • cygsoft
                New Member
                • Jun 2007
                • 29

                #8
                Editing and Deleting Dynamic rows

                Hi

                here is my code.

                <html>
                <body>
                <script>
                function addRow()
                {
                var newRow = document.all("t blGrid").insert Row();
                var oCell = newRow.insertCe ll();
                oCell.innerHTML = f1.fullname.val ue;
                oCell = newRow.insertCe ll();
                oCell.innerHTML = f1.emailaddress .value;
                oCell = newRow.insertCe ll();
                oCell.innerHTML = "<input type='button' value='Edit' onclick='editva lidate(this);'/>&nbsp;&nbsp;<i nput type='button' value='Delete' onclick='remove Row(this);'/>";
                }

                function removeRow(src)
                {
                var oRow = src.parentEleme nt.parentElemen t;
                document.all("t blGrid").delete Row(oRow.rowInd ex);
                }

                </script>
                <table id="tblGrid">
                <tr><td></td></tr>
                </table>
                <form name="f1">
                Fullname<input type="text" name="fullname" ><br>
                EmailAddress<in put type="text" name="emailaddr ess"><br>
                <input type="button" value="add" onclick="addRow ();">
                </form>
                </body>
                </html>





                This coding works fine for deleting a particular row. But when i click the "Edit" button of the row created, I need those two values such as "name" and "emailaddre ss" to be brought back to the textbox and edited and then send back..

                It would be so useful if anyone help me.
                Thanks

                by
                sudha

                Comment

                • cygsoft
                  New Member
                  • Jun 2007
                  • 29

                  #9
                  this is needed urgently can anyone help pls.........

                  Comment

                  • cygsoft
                    New Member
                    • Jun 2007
                    • 29

                    #10
                    help needed urgently....... .

                    Comment

                    • cygsoft
                      New Member
                      • Jun 2007
                      • 29

                      #11
                      editing the values dynamically

                      I have a table contains the email Id and edit and delete options.and i hava a create new button.If iclick the createnew button it goes to the jsp page it contains email Id text field.if we enter the email id and submit on that page control goes to the same page and i want to see the email id dynamically in that table the edit and delete options also created dynamically.if i click the edit option it goes to the entire email id page and i change the password information it will change the password and submit means it returns the same page.

                      if i click the delete option div should displayed,in that two options one is yes and another is no ,if i click yes that entire row will be deleted, if click no just div only deleted and then entire row will be delete while checked some checkbox

                      can u help me ...
                      thanks in advance.....

                      Comment

                      • r035198x
                        MVP
                        • Sep 2006
                        • 13225

                        #12
                        Originally posted by cygsoft
                        help needed urgently....... .
                        There are several ways of doing this.
                        One way is to write the email in a hidden input for each row.

                        Comment

                        • acoder
                          Recognized Expert MVP
                          • Nov 2006
                          • 16032

                          #13
                          Post what code you have so far so we can work with that.

                          Comment

                          • acoder
                            Recognized Expert MVP
                            • Nov 2006
                            • 16032

                            #14
                            These seem to be on the same topic, so I've merged the threads.

                            Comment

                            • acoder
                              Recognized Expert MVP
                              • Nov 2006
                              • 16032

                              #15
                              I've merged about 4 or 5 threads. Please keep all posts in one thread. It's very difficult if the posts are all in separate threads and you have 2/3 answers in different places.

                              Comment

                              Working...