Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • 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

Submit dynamically created form with jQuery

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all

I've been trying to achieve this for several hours but to avail. Hope I can find enlightenment here....

I am trying to make a dynamically form created by jquery in div element in a.php , submit to b.php, then return the result the same div in a.php

So far this is my code

a.php



When I click the a#igniter, it will populate the div panel with a form. I managed it with this piece of code.



With this i have a form (id="group_edit") in div panel in a.php. Great! But, whenever i submit, the whole page goes to b.php instead of the div....

tried this code as well:




but seems like it just never goes there.....

I tried the solutions here:
https://coderanch.com/t/482557/HTML-JavaScript/Submit-dynamically-created-form-jQuery
and
https://coderanch.com/t/480299/HTML-JavaScript/jQuery-form-submit-Form-plugin#2166604

but doesn't work for me....

Please help me.... thanks.....
 
Yoke Lee
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually........... I solved it.

This is the final code that works:



Hope it helps any other who needs. Cheers
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was hoping you might be able to help me out. I am pretty new to coding, but I am using a php/ajax script to dynamically load my drop down menus from a mySQL db.
Here is the code I'm using.



Is it possible to use something similar to what you've got to submit my results into my Results div instead of a separate page?

Thanks!
 
Getting married means "We're in love, so let's tell the police!" - and invite this tiny ad to the wedding:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic