• 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Pass form object to JSP

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
can anyone help me....
var objDataform=document.forms["CRP_FORM"];
var url="..\\..\\..\\..\\webdesktop\\CRP\\InsertData.jsp";
var ReturnVal=Fun_Ajax(url,'');

How can i pass form object (objDataform) to jsp so that in JSP i can retrieve values of fileds on the form and insert their values into a table.
Above code written in a JS file and i m using AJAX.

Thanks..
 
Sheriff
Posts: 67651
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
You can't pass form elements as part of a request. They are DOM objects that exist only on the client and have no meaning on the server.

Are you really asking how to pass the value of the element to the JSP in the Ajax call?
 
Bear Bibeault
Sheriff
Posts: 67651
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
In any case, this is not a JSF question and has been moved to a more appropriate forum.
 
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

How can i pass form object (objDataform) to jsp so that in JSP i can retrieve values of fileds on the form and insert their values into a table.



Generally, let say you have a form like below:


Then in the JSP, you can do this to retrieve the value of the text field from the form:

You can then add code to insert to your table.

Like Bear mentioned, you can't pass the form itself.

Is this somewhat you're looking for?
Hopefully it helps a little bit at least.
reply
    Bookmark Topic Watch Topic
  • New Topic