Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to submit a div alone ?  RSS feed

 
Thanuja Vishwanath
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I just need a help in building a UI. Was wondering how to do and vish asked me to mail you guys.

I have a requirement where last column in a table has drop down and submit button. This table is dynamically generated. Last column in each row has drop down , link and submit button. I just attached a sample html file. If you check that file last column has links and submit buttons. If user clicks the link ADD then a dropdown and save button will be shown. User then selects an item from drop down and clicks SAVE button. When user clicks this, I don’t want to submit the whole form. Instead I want to submit that particular column or div.

I have seen such implementation in

http://www.cleartrip.com/trains/results?from_city=Coimbatore&to_station=BNC&class=SL&date=30-11-2010&adults=1&children=0&male_seniors=0&female_seniors=0

In the above link if you click check availability button then whole form is not submitted. My requirement is to implement exactly the same feature. . I know that it should be done using jquery and ajax. But iam not sure how to proceed . So if you guys have any idea as how to implement this can you please explain. If I put everything in that column inside a div, is there a way to submit a div alone? Or submit a form and refresh only that particular div? I referred this link

http://efreedom.com/Question/1-868890/Ajax-Refresh-DIV-Submit

but here html content is passed from server and they just replace that content with the existing content of that particular div. In my case I cannot return html content.

 
Praneeth Yeri
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Firstly please forget about submitting a form or div. Using jquery , attach a event handler to the buttons using bind method . bind allows us to provide a java script method where in we can handle the event . In this method use $.ajax and make the necessary service call . $.ajax allows you to handle the response using a javascript handler . The re
Sponse can be ploin text also which supports your case
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!