• 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

How to call javascript function from my jsp Page?

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all, this is my first subscribtion on this site hope u help me.

i have a jsp page that i use to add ,delete, and update student record ! when i call this page i send the command in a request and check if its add or delete or update , the problem is if the command is add the id field must be disabled else it must be enabled !! i did this but it does not work :


<%
String command = request.getParameter("command");
if(command.equals("add")){
<script>
setDisabled();
</script>
}
%>




<script>
function setDisables(){
document.main.id.disabled=false;
}
</script>
[ May 11, 2005: Message edited by: Bear Bibeault ]
 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I am not wrong, on which event you wanna call this method?
Because JSP renders on server-side and the javascript is a client-side technology.
 
moh sak
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanx 4 ur replays , and i forget to close the scriptlet %> in here only.

i am trying to call this method when i redirect to that page if i select the delete student option from the main page menue ! hope this will be more spec.
 
moh sak
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Adeel Ansari:
If I am not wrong, on which event you wanna call this method?
Because JSP renders on server-side and the javascript is a client-side technology.



thanx 4 ur replays , and i forget to close the scriptlet %> in here only.

i am trying to call this method when i redirect to that page if i select the delete student option from the main page menue ! hope this will be more spec.
 
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
moh sak,

JavaRanch is a community of people from all over the world, many of who are not native English speakers. While using abbreviations like "u" instead of spelling out "you", and "thanx 4 ur" instead of "thanks for your", may be convenient when text messaging your friends on a cell phone or in a chat room, it presents an extra challenge to those that are already struggling with English. Additionally, such shortcuts may confound automated translation tools that patrons of the Ranch may be making use of.

I would like to ask for your help in making the content of JavaRanch a little easier to read for everybody that visits here by not using such abbreviations.

thanks,
bear
Forum Bartender
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic