Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > javascript not working in servlet.Please help.

Thread Tools

javascript not working in servlet.Please help.

adiraju_anuradha adiraju_anuradha is offline
Junior Member
Join Date: Mar 2012
Posts: 7

import javax.servlet.*;

import javax.servlet.http.*;

import java.lang.*;

public class HiddenDropDown extends HttpServlet{

public void service(HttpServletRequest req,HttpServletResponse res) throws IOException{

PrintWriter out = res.getWriter();

String theplace = req.getParameter("place");

String user2 = req.getParameter("usernamehidden");

out.println("username: "+user2);

out.println("place: "+theplace);



out.println("script language=\"javascript\"");

out.println("$(document.ready(MyFunction(){$('#Sel ectHidden').append($(\"<option>\"+$('#userplacehid den').val()+\"</option>\");return false;})");



out.println("<form action=\"/Hostel/hve\">");

out.println("<input type=\"hidden\" name=\"userplacehidden\" value=\"" +theplace+" \"/>");

//out.println("<input type=\"hidden\" name=\"usernamehidden\" value=\"" +user2+" \"/>");

out.println("<select id=\"SelectHidden\" name=\"SelectHiddenThing\">");

out.println("<option onClick=\"MyFunction();\"> enter here </option>");


out.println("<input type=\"submit\" value=\"Back\">");


Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help: Javascript not working in Firefox "event not defined" Wiseman Javascript 1 07-25-2008 03:04 PM
Working with XML in JavaScript / Как работать с XML в Javascript'е? noff Javascript 0 06-14-2007 12:46 PM
wifi not working on new hp, or not working after live update =?Utf-8?B?RHJhZ29ueA==?= Wireless Networking 1 10-01-2005 11:17 PM
Cookies working on intranet but NOT working on Internet Martin Heuckeroth ASP .Net 5 04-01-2005 01:37 AM
Regular Expression validators NOT working, Required Field validators ARE working Ratman ASP .Net 0 09-14-2004 09:36 PM