File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Showing form elements on ajax call Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Showing form elements on ajax call" Watch "Showing form elements on ajax call" New topic
Author

Showing form elements on ajax call

kaustubh kurambhatti
Greenhorn

Joined: Oct 21, 2009
Posts: 13
I have 1 big form which is made in jsp. After a few form elements i have a drop down box, on the change of its value it depends that whether the next form elements should be displayed or not. But then its necessary to make sure that it will be belong to a single form only. Using ajax i am able to get a div tag populated successfully.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I'm not sure what you're asking--if you're just showing some form elements that were hidden before there shouldn't be an issue. Are you saying you're filling a div with the result of an Ajax call that returns a segment of a form?
kaustubh kurambhatti
Greenhorn

Joined: Oct 21, 2009
Posts: 13
Dear David ,
Thanks a lot for trying to resolve my issue. Actually i m new in web desinging and programming field. But somehow i managed to get the solution.

I have 1 big form which i divide into 2 div tags. In 1st div tag there are several elements of the form and 1 drop down menu. On change of its value it checks in database for its relevant entry. If the concerned record is present in table then i dont need to show the further form(which i divided in 2nd div tag). Else i shd display the entire form and and allow user to submit the data.

So i was missing with its dynamicness.

I checked the presence of value in database through ajax. And was able to display the message whether the value is present or not. So through style tag i hide the display in that 2nd div. And in ajax function i changed the style property of div tag and made that visible.

Hence its the solution.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Showing form elements on ajax call
 
Similar Threads
AJAX Conditionally Render Components
AJAX Dynamic Wizard-like Form Problems
how to keep register page data if register fails
Ajaxstart/Ajaxstop Global Handler Form Reference
Form Reset