SCJP 6 [SCJP - Old is Gold]
Ram Narayan.M wrote:yes you can attain using AJAX... Using "OnClick" event on Radio button, Toggling of URL should be done correspondingly based on option selected...
Bear Bibeault wrote:Ajax is not necessary. Just a little JavaScript to change the action of the form based upon what element is selected.
Ram Narayan.M wrote:yes you can attain using AJAX... Using "OnClick" event on Radio button, Toggling of URL should be done correspondingly based on option selected...
Apple Khoa wrote:
May I know what do you mean by "Just a little JavaScript to change the action of the form based upon what element is selected"?
By the way, I have tried using Ajax as suggested by Ram Narayan.M
SCJP 6 [SCJP - Old is Gold]
Bear Bibeault wrote:You can write one or two lines of JavaScript to establish an event handler for the change of selection and replace the action value accordingly.
Hi Bear Bibeault,
I have tried using an event handler onclick="location.href='/EasyQnServlet'" (Line 36 of HTML code) & onclick="location.href='/EasyQnServlet'" (Line 37) to perform the task of mapping to several servlets with one webpage. However, I am still not getting the desired output. The content for 'question' and 'answer' (radio buttons) are not being displayed; only the content 'title' and 'instruction' (text boxes) appear on the output.
Could you kindly advise me on this issue?
My HTML code:
My web.xml code:
Bear Bibeault wrote:You might want to fix the quoting in your reply.
In any case, just post the relevant parts of the code or an SSCCE. I'm not going to look at code that covers more than one screen to find the one line of JavaScript that's relevant.
By the way, when it comes to event handling, you really want to use jQuery or similar. Otherwise, you've got to deal with IE's nonsense.
SCJP 6 [SCJP - Old is Gold]
Ram Narayan.M wrote:What is your plan to render on toggling Easy and Difficulty mode?...
Meanwhile In,
<
location.href cannot be invoked in this manner... It should be embodied in a function and have to call that function... But, using location.href will redirect to the next page...
And you cant get the effect of actions based on toggling effect happening in the same page...
Consider Paul's rocket mass heater. |