JSP - Update displayed content & session variables when user clicks on a button

Ads
 

JSP - Update displayed content & session variables when user clicks on a button

View Answers

February 2, 2009 at 12:54 AM

Hi joel

i could help better, if you can show your code to me.



Thanks...

February 2, 2009 at 4:27 PM

Thanks for the reply!

I've been trying to figure out what the best way/quickest way is to do this. I've been hoping that some combination of JSP and javascript would work since my knowledge base is in Java. Here is something like what I am trying to do using excerpts from my code:

<SCRIPT type="text/javascript">
function addPerception() {
// What to put here?
}
</SCRIPT>

<%
Player player = (Player)session.getValue("player");
java.text.DecimalFormat formatter = new java.text.DecimalFormat("#0.00");
%>

<td style="background-image: url(images/HitterMod/smalltopbg.jpg); background-repeat: repeat; font-family: Calibri; text-align: center;"><big><big><div id="perceptionValue"><%= formatter.format(player.getPerception()) %></div></big></big></td>

<td><input src="images/HitterMod/add.jpg"
clickimage="images/HitterMod/test.jpg" height="25" type="image" width="51" id="addPerception" onclick="addPerception()"></td>

My hope is that when the user clicks on the add.jpg image, that the perception value displayed will incremented if certain requirement are met. A simple working example would be amazing!

Many thanks!

Joel

Ads









Related Tutorials/Questions & Answers:
forwarding request to a jsp when user clicks on back button in ie
forwarding request to a jsp when user clicks on back button in ie  Hi all, I have developed a web based application. After user log out... we forward request to a jsp page whenever user clicks on back button
jsp :how to edit table of data displayed using jsp when clicked on edit button
jsp :how to edit table of data displayed using jsp when clicked on edit... want to delete this information in table when click on delete button and save the data when clicked on save button.. how can i do
Advertisements
set cookieless session variables in jsp
set cookieless session variables in jsp  I want to know how to set cookieless session variables in jsp, because when I run my application multiple... that . So, please tell is it possible in jsp to use cookieless session variables
Save the content in my wysiwyg editor into specified location of user when clicked on save button in my web page
Save the content in my wysiwyg editor into specified location of user when clicked on save button in my web page  I am using wysiwyg editor to display some static content.My requirement is that This static content can be edited
change database values when click next button on jsp page
change database values when click next button on jsp page  How to retrive database values rondomly and display jsp page ,when user click next and previous bottons change the values on jsp page
Session expire and back button in jsp and servlet .
Session expire and back button in jsp and servlet .  Hii Sir... to invalidate the session after a certain interval of time and after clicking logout button.Means that after session expiry time and logout action no one can access
how to disable submit button after login in jsp
an application and when user logs in welcome page is displayed. When user clicks... to disable submit button after login in jsp? Thanks   Hi, You can use the http session variable in the login.jsp page. When use logs in create
jsp :how to edit table of data displayed using jsp when clicked on edit button
, there is a button which consists of that particular id. When the user clicks...jsp :how to edit table of data displayed using jsp when clicked on edit... want to edit this information in table when clicked on edit button and save
Remove attribute in user defined session - JSP-Servlet
Remove attribute in user defined session  Hi, How we can set remove attribute for user defined session. I am appreciating if you are sending solution as soon as possible? Thanks, Sanat Kumar
when radio button is selected corresponding jsp page should open
when radio button is selected corresponding jsp page should open  how to write code in HTML & jsp, when we click on radio buttons the corresponding jsp page should open..!   <html> <script> function
How to prevent from navigating to ck buttonnext page when user reaches login page using back button
How to prevent from navigating to ck buttonnext page when user reaches login... goback to user login page using back button and agin click browser forward button,the 2nd page session gets expired but on next click on forward button,the pdf
session variables server side
session variables server side  how to hold session variable for server side..?   request.getSession().setAttribute("wellSelection", uid
Radio Button in HTML
Radio Button in HTML is a type of input form that allows a user to select one button from a group of button. When a user clicks on a radio button, it becomes... Button in HTML: The use of a radio button is to allow a user to make one
how to disable submit button in jsp using servlet when some condition is satisfied
how to disable submit button in jsp using servlet when some condition is satisfied  how to disable submit button in jsp using servlet when some condition is satisfied
Clearing session in jsp
Clearing session in jsp  i have developed a web appilcation using jsp and when user try to logout, session is not clearing even though i have used..."); session.removeAttribute("type"); When i press back button of browser it redirects to previous page
list to be displayed in jsp page.
list to be displayed in jsp page.  Can any one help me? Am developing the code in struts.I have a list in action class that has to be printed in the dropdownlist in another jsp page.Please help me in the code.. Thank u
JSP Back Button
JSP Back Button          Jsp Back Button enables the user back... and displayed in text area. The Back button takes the user back to the page they just
how to initialise variables in jsp?
how to initialise variables in jsp?   1. what is the problem in the folloing jsp <%@ page import..." %> <html:html> <head> <meta http-equiv="Content
session in jsp
session in jsp In this section you will learn about session in JSP. Here you will learn about how to use the HttpSession in JSP. session in JSP is defined... of its Servlet. Session specifies the single interactive user. An implicit
Session In JSP
; Cookies in JSP When cookie based session management is used, a token...Session In JSP      ... of World Wide Web (WWW).    Session Management in JSP
insert user session into other oracle database table
insert user session into other oracle database table   hello i am a doing my project in jsp-servlet. i have doubt that when a user login to his account after that i store his name into session and when the user write any
Action Submit Html
an user enter some text in the text field User name) and clicks the submit button...;  Action Submit in Html is used to submit a form, When a user clicks on a submit button, the form is sent to the specific address
Session timeout message need to be displayed - Java Beginners
Session timeout message need to be displayed  Hi, I want to display a session timeout on website. i want to find session - remaining time set in web.xml. Thanks Manu
Duplicated Session Variables
Duplicated Session Variables     ... a new session variable because it has been created by the JSP container for you... name. Consider we have declared a session variable true in jsp page <%@ page
session value not get in many jsp page.
,response); and get session value on jsp page by follwing:- String user=(String)session.getAttribute("user"); this is work but when this code is use in other jsp...session value not get in many jsp page.  I am using servlet to set
JSP JSTL c:when tag
JSP JSTL c:when tag   ... the jstl when tag in jsp. Basically, the choose, when, and otherwise tags can... prompt the user to enter to enter any number. After submitting the button
print form information when click on print button
print form information when click on print button   Sir,I desingn institute webside using jsp and strut by using platform netbean 7.2.So request you please help for printing form information by clickin print button after submit
button to accept user input
button to accept user input  private void jButton1ActionPerformed... the radiobutton and spinner.The user input does not show on my Studentinfo.mdb... that accepts firstname, lastname and gender from user and insert to database
ID using get the databse latest value and displayed in jsp
ID using get the databse latest value and displayed in jsp   I have some text box like name address city ,I have submit button and preview button ... once click the submit button the data will be stored in mysql database
How do servlets work? Instantiation, session variables and multithreading
How do servlets work? Instantiation, session variables and multithreading  How do servlets work? Instantiation, session variables and multithreading
JSp session time out
JSp session time out  Consider a case where we are working on a java... for it??   If you want to make session timeout programatically, you can use... the maximum time in seconds before a session becomes invalid. Its syntax

Ads