assigning one user to another - java servlet, html and javascript and ajax - How to?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tangara
    New Member
    • Jan 2010
    • 27

    assigning one user to another - java servlet, html and javascript and ajax - How to?

    I have created a form where there's an option or 2 user types.

    All the data collected will be posted to my msaccess table.

    I have user java servlet to link the html to msaccess table so that user can view the table.

    Now I need to complete another task which is I can allow 1st user to assign 2nd user to any existing 1st users available on my database.

    I hope someone can advise me how to go about doing this.
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5390

    #2
    it is a bit confusing ... could you please explain that a bit better or give a more detailed example for that requirement?

    kind regards

    Comment

    • tangara
      New Member
      • Jan 2010
      • 27

      #3
      I have this html form whereby user enter their information including choosing the option of usertype 1 and usertype2.

      All the data collected will be posted to my msaccess table.

      I have created a java servlet to link the html to msaccess table so that user can view the table.

      Now I need to complete another task which is I can allow the user who view my table to assign user type 2 to any existing user type 1 in my msacess table. N this will also be show all the view table page using the servlet.

      I hope the explantion is ok this time. tks.

      Comment

      • tangara
        New Member
        • Jan 2010
        • 27

        #4
        Sorry the last sentence should read :-

        When the user view the table, they can see that the assigning of usertype 2 to usertype 1 in the table also. The Ms access table will show the assigning accordinlgy also.

        Comment

        • gits
          Recognized Expert Moderator Expert
          • May 2007
          • 5390

          #5
          sorry ... but i don't get it yet. let me summarize what i could understand until now.

          you have a webpage where you collect some data from the user. therefor the user decides to input some data for a usertype? let's say he types in some data for usertype 2 then you store the data that way. for example the user enters a name, age and gender.

          what should happen now? especially whatfor are the different usertypes good? is there a hierarchy or whatever? or are the usertypes linked somehow? is there a special direction from usertype 1 to 2 and/or vice versa?

          kind regards

          Comment

          • tangara
            New Member
            • Jan 2010
            • 27

            #6
            No. The user has an option button to choose whether he wants to be a user type 1 or user type 2. the user also has to enter the rest of the data like name, gender etc.

            And the rest of the story follows. Hope you can understand it now.

            Comment

            • tangara
              New Member
              • Jan 2010
              • 27

              #7
              Here's is my html code to show you :-
              Code:
              <body>
                      <form id="frmData" name="frmData" action="ProcessAddMember2"
                            method="post" >
                          <table border="1" style="width:500px;padding:3px;" table id="myTable" >
                             
                              <tr>
                                  <td colspan="2" class="tdTitle" >Member Registration</td>
                              </tr>
                              <tr>
                              <thead>
                                  <td>Full Name</td>
                                  <td><input type="text" id="txtFullName" name="txtFullName" value=""></td>
                          </thead>
                          </tr>
                              <tr>
                                  <td>Email</td>
                                  <td><input type="text" id="txtEmail" name="txtEmail" value=""></td>
                              </tr>
                              <tr>
                                  <td>Address</td>
                                  <td><input type="text" id="txtAddress" name="txtAddress" value=""></td>
                              </tr>
                              <tr>
                                  <td>NRIC No</td>
                                  <td><input type="text" id="txtNRIC" name="txtNRIC" value=""></td>
                              </tr>
                              <tr>
                                  <td>Contact</td>
                                  <td><input type="text" id="txtContact" name="txtContact" value=""></td>
                              </tr>
                              <tr>
                                  <td>Gender</td>
                                  <td><input type="radio" id="txtGender" value="Male" name="txtGender"/>Male
                                      <input type="radio" id="txtGender" value="Female" name="txtGender"/>Female</td>
                              </tr>
                              <tr>
                              <thead>
                                  <td>Type</td>
                                  <td><select name="txtMember" id="txtMember">
                                          <option>User type 1</option>
                                          <option>User type 2</option>
                                      </select>
                                  </td>
                          </thead>
                              </tr>
                            <tr>
                                  <td>Remarks</td>
                                  <td><input type="text" id="txtRemarks" name="txtRemarks"></td>
                              <tr>
                                  <td colspan="2"><div id="divMessage"></div></td>
                              </tr>
                              <tr>
                                  <td align="right">
                                  <td align="right"><input type="button" id="btnSubmit" name="btnSubmit" value="Submit" onclick="checkForm()"/>
                                      <input id="reset" type="reset" name="reset" value="reset" onclick="clearErr();"/></td>
                              </tr>
                          </table>
                      </form>
                  </body>
              </html>
              Last edited by gits; Jan 4 '10, 05:45 PM. Reason: added code tags

              Comment

              • gits
                Recognized Expert Moderator Expert
                • May 2007
                • 5390

                #8
                ok ... that form collects data from a user and you add that to the database ... i understood that already ... and now: What is the rest of the story that follows from here? ... that was my question above ...

                Comment

                • tangara
                  New Member
                  • Jan 2010
                  • 27

                  #9
                  Name Email Address NRIC Contact Gender Type Remarks
                  Mandy Low ****@example.or g null S1110432J null null null null
                  fdg sfg sgf sdfg sdfgd null User type1
                  rgfgrf null User type2
                  wttr wrte ertr wet ertet Female User type1
                  Kee Tuan Bin ****@example.or g Seambawang S8439031C 98768122 Female User type2 Happy New Ye

                  I got this table when I run my servlet. So, the story is how do I make the user able to assign user type2 to user type1?
                  Last edited by Dormilich; Jan 5 '10, 01:40 AM. Reason: removed email address

                  Comment

                  • gits
                    Recognized Expert Moderator Expert
                    • May 2007
                    • 5390

                    #10
                    what should the user assign? for example what should/wants Mandy Low do now? What should be the result ... should Mandy Low have entries for both of the usertypes so that two entries are linked? or should she just be able to update (replace) her usertype?

                    Comment

                    • tangara
                      New Member
                      • Jan 2010
                      • 27

                      #11
                      there will be a separate log in page to allow a staff user to assign usertype2 to mandy low who is user type 1.

                      Comment

                      • gits
                        Recognized Expert Moderator Expert
                        • May 2007
                        • 5390

                        #12
                        so the staff member logs in - then chooses the Mandy Low record from a list ... the data are loaded from this record and the staff member updates the usertype? is that the goal of that all?

                        in case it is then you would need to create a list-control that displays the available records, let the user choose one record and insert the record's data into a form where the staff member could edit the values ... you might use a form or a grid-control for this purpose ...

                        Comment

                        • tangara
                          New Member
                          • Jan 2010
                          • 27

                          #13
                          Yes. That is the 1st task.

                          But, I'm not sure how to go about implement this list-control records things. Would be be able to advise?

                          What kind of codes I must modify in my html form - the one where I collect the data from user1 and user 2 as per my html form above?

                          I

                          Comment

                          • gits
                            Recognized Expert Moderator Expert
                            • May 2007
                            • 5390

                            #14
                            there are different options to create such a list ... you might create a select-node with the user-records as options and on select of one of the records you might fill a form like the one you already have.

                            you could even create a table from the records, assign a click-event to the rows and then fill the form or create a input node in the clicked cell to edit the values in place - so that it is more like a grid control.

                            anyway i think you would need to have another page where you would have implemented this handling ... and of course you might reuse the form there ... since it would collect basicly the same data. so the 'new' thing you would need to build is the record-list from where you might choose a record.

                            kind regards

                            Comment

                            • Frinavale
                              Recognized Expert Expert
                              • Oct 2006
                              • 9749

                              #15
                              Sorry, maybe I'm misunderstandin g something, but how is this a JavaScript question?


                              -Frinny

                              Comment

                              Working...