• 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

passing javascript variable in java method

 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I have got javascript variable and i want to pass tht variable to java method
do somebody have any idea how do i go about it ?
following is the javascript function
<script language="javascript">
function isFieldEnabled(jsfieldName,tagId)
{
<%
//assignment to java variable from javascript
String fieldName = jsfieldName;
boolean fieldStatus = user.getUserProfile().isProfileFieldEnalbled(fieldName);
if(fieldStatus){
%>
document[getNetuiTagName("parentForm")][getNetuiTagName(tagId)].disabled = true ;
<%}%>
}
</script>
I want to pass a jsfieldName(javascript variable) in isProfileFieldEnalbled of user class how do i do that ?
waiting for positive response
regards
Rishi Yagnik
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To pass the variable you need to submit a form to pass it to the server since you are talking about client/server interaction.

Eric
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can't be done.
reply
    Bookmark Topic Watch Topic
  • New Topic