• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Help ME PLZ. Very Soon..

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Friends!!
How can i use JavaScript Variable within JSP page..
like my requirement is, i want to use that JavaScript variable in a SQL-query (everything within JSP page)..
plz look into this code below..
--code start--

--code end--
in the above code, how can i use JavaScript variable (str1_mod) outside the html page in a query while preparing servlet code(observe the query)...if i run the above code, 'am getting compilation error of UnKnown Variable str1_mod ..
'am using Tomcat4.1.18 server..
'am in real-need of you..
Kindly Help me Plz..
thanks in advance,to everyone,
anticipating replies very eagerly..
Sreekanth.
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i didn't check your complete code, but as far as i understood you want to use a Javascript variable in a JSP.
The way you are trying to do this will never work, cause the JSP code is executed on server side and your javascript on client side. This means
while the JSP is created and delivered to the client. Then on client side
the Javascript variable is set.
Try to create a form which has another JSP or Servlet as action. To this
you pass the content of your Javascript variable over some parameter in the URL (GET) or within a hidden field you filled with your javascript code.
Hope that helps you out
 
reply
    Bookmark Topic Watch Topic
  • New Topic