473,513 Members | 2,391 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

27 New Member
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.
Jan 4 '10 #1
23 3004
gits
5,390 Recognized Expert Moderator Expert
it is a bit confusing ... could you please explain that a bit better or give a more detailed example for that requirement?

kind regards
Jan 4 '10 #2
tangara
27 New Member
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.
Jan 4 '10 #3
tangara
27 New Member
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.
Jan 4 '10 #4
gits
5,390 Recognized Expert Moderator Expert
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
Jan 4 '10 #5
tangara
27 New Member
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.
Jan 4 '10 #6
tangara
27 New Member
Here's is my html code to show you :-
Expand|Select|Wrap|Line Numbers
  1. <body>
  2.         <form id="frmData" name="frmData" action="ProcessAddMember2"
  3.               method="post" >
  4.             <table border="1" style="width:500px;padding:3px;" table id="myTable" >
  5.  
  6.                 <tr>
  7.                     <td colspan="2" class="tdTitle" >Member Registration</td>
  8.                 </tr>
  9.                 <tr>
  10.                 <thead>
  11.                     <td>Full Name</td>
  12.                     <td><input type="text" id="txtFullName" name="txtFullName" value=""></td>
  13.             </thead>
  14.             </tr>
  15.                 <tr>
  16.                     <td>Email</td>
  17.                     <td><input type="text" id="txtEmail" name="txtEmail" value=""></td>
  18.                 </tr>
  19.                 <tr>
  20.                     <td>Address</td>
  21.                     <td><input type="text" id="txtAddress" name="txtAddress" value=""></td>
  22.                 </tr>
  23.                 <tr>
  24.                     <td>NRIC No</td>
  25.                     <td><input type="text" id="txtNRIC" name="txtNRIC" value=""></td>
  26.                 </tr>
  27.                 <tr>
  28.                     <td>Contact</td>
  29.                     <td><input type="text" id="txtContact" name="txtContact" value=""></td>
  30.                 </tr>
  31.                 <tr>
  32.                     <td>Gender</td>
  33.                     <td><input type="radio" id="txtGender" value="Male" name="txtGender"/>Male
  34.                         <input type="radio" id="txtGender" value="Female" name="txtGender"/>Female</td>
  35.                 </tr>
  36.                 <tr>
  37.                 <thead>
  38.                     <td>Type</td>
  39.                     <td><select name="txtMember" id="txtMember">
  40.                             <option>User type 1</option>
  41.                             <option>User type 2</option>
  42.                         </select>
  43.                     </td>
  44.             </thead>
  45.                 </tr>
  46.               <tr>
  47.                     <td>Remarks</td>
  48.                     <td><input type="text" id="txtRemarks" name="txtRemarks"></td>
  49.                 <tr>
  50.                     <td colspan="2"><div id="divMessage"></div></td>
  51.                 </tr>
  52.                 <tr>
  53.                     <td align="right">
  54.                     <td align="right"><input type="button" id="btnSubmit" name="btnSubmit" value="Submit" onclick="checkForm()"/>
  55.                         <input id="reset" type="reset" name="reset" value="reset" onclick="clearErr();"/></td>
  56.                 </tr>
  57.             </table>
  58.         </form>
  59.     </body>
  60. </html>
  61.  
Jan 4 '10 #7
gits
5,390 Recognized Expert Moderator Expert
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 ...
Jan 4 '10 #8
tangara
27 New Member
Name Email Address NRIC Contact Gender Type Remarks
Mandy Low ****@example.org 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.org 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?
Jan 5 '10 #9
gits
5,390 Recognized Expert Moderator Expert
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?
Jan 5 '10 #10
tangara
27 New Member
there will be a separate log in page to allow a staff user to assign usertype2 to mandy low who is user type 1.
Jan 5 '10 #11
gits
5,390 Recognized Expert Moderator Expert
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 ...
Jan 5 '10 #12
tangara
27 New Member
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
Jan 5 '10 #13
gits
5,390 Recognized Expert Moderator Expert
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
Jan 5 '10 #14
Frinavale
9,735 Recognized Expert Moderator Expert
Sorry, maybe I'm misunderstanding something, but how is this a JavaScript question?


-Frinny
Jan 5 '10 #15
gits
5,390 Recognized Expert Moderator Expert
Hi Frinny,

in case it deals from now on with the record-list control and events on a webpage it turns out as a JavaScript question ... probably with some ajax-based data-streams or something like this ... @the moment it is a bit unclear ... of course ...

kind regards,
gits
Jan 5 '10 #16
tangara
27 New Member
Hi,

Sorry I'm really new into this. Do you mind share with me any example codes that I can follow and I follow them accordingly?

Thank you.
Jan 5 '10 #17
tangara
27 New Member
Sorry just to check my understanding.

I have to create another page - a jsp page? to get the data from the same html form. This jsp page would have a control list - user type1 and user type 2 inside is that right?

After that when the servlet display that jsp page, it would enable the staff the do the assigning by pulling down the drop down list at user type 2 a list of all the names of usertype 1 and select the user type 1. After that, the user type 1 will appear in a separate column, is that right?

But, how to implement things like that?
Jan 5 '10 #18
acoder
16,027 Recognized Expert Moderator MVP
For the JSP code help, ask in the Java forum. Even if you're going to eventually use Ajax, you'll still need to use some server-side code to connect to the database and get the data.
Jan 8 '10 #19
tangara
27 New Member
Ok. I'll post it to jsp forrum. tks.
Jan 20 '10 #20
tangara
27 New Member
I have this form which has an option to choose between user 1 and user 2, along with other infor like name, id, address, contact etc.

Now, I need to make a log in administrator to assign user 2 to user 1 and populate it to a table for viewing.

How do I make it happen?
Jan 20 '10 #21
gits
5,390 Recognized Expert Moderator Expert
threads merged - please keep everything that is related to one issue in one thread. in case you wanted to ask something about jsp then ask in the java-forum since JavaScript doesn't have anything to do with JSP.

regards,
MOD
Jan 20 '10 #22
tangara
27 New Member
Seems like there's no one that can answer this question or know how.
Jan 21 '10 #23
acoder
16,027 Recognized Expert Moderator MVP
You probably meant to post this in the Java forum. Here's a link to the Java forum.
Jan 31 '10 #24

Sign in to post your reply or Sign up for a free account.

Similar topics

3
8513
by: ppcguy | last post by:
i've got a progress bar that tracks a process running on a server (java servlet). i know i can refresh the page and update the status...but this results in the page being redrawn everytime. ...
7
11043
by: Oleg Konovalov | last post by:
Hi, I am trying to pass a bunch of checked checkboxes (Javascript array) from page1 to the Java action class on subsequent web page (page2). (on page 1 I have a bunch of DB rows with a checkbox,...
9
41697
by: misdst23 | last post by:
Hi, I know I can call a static java method within javascript by using the <% ... %tags. But how can pass a javascript variable ? function thefunction() { var = javascriptvariable ;
2
2579
by: archanagp | last post by:
Hi, I am trying to develop a portlet which has a javascript function which uses ajax to call a servlet in the server. The portlet I am trying to develop is in websphere application developer. My...
8
28442
by: ajos | last post by:
hi frnds, im trying to convert my servlets database configuration from ms access to mysql database.however im getting some error like no driver found exception. to verify this error ive...
6
6839
by: moongeegee | last post by:
I have compile my java program as myjava.class. And I can run as "java myjava" without any program. As now, I need to execute myjava.class in javascript. Please shed a light how to execut "java...
1
8116
sid0404
by: sid0404 | last post by:
Hi I need to send data from my servlet to my html(which contains AJAX), so as per the motivation of the AJAX, this should be done without my webpage reloading / refresh. my code on the ajax...
2
2641
by: ramprakashjava | last post by:
This is index.jsp page code: <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> <%@ taglib...
0
7265
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7171
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7388
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7111
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7539
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5692
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4751
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3240
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
461
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.