Jump to content

Submit Form From DIV Tag


Zergman

Recommended Posts

Wasn't sure where to post this but this is an issue with CodeIgniter Pagination.

 

I have a big search form.  I enter search criteria and it works and returns my results along with working Pagination.  Problem is when I click on a pagination link, the page reloads but it submits an open query with no criteria so it searches all records and the pagination breaks.

 

Solution i'm trying to impliment is to have a hidden form that stores the search criteria so when a pagination link is clicked, it submits the hidden form.

 

Problem i'm having is making the pagination links submit the hidden form.  I'm trying to wrap it with a div tag and add an onclick to it but it isn't working.

 

How would I do this?

Link to comment
https://forums.phpfreaks.com/topic/220204-submit-form-from-div-tag/
Share on other sites

Well got the div submitting

<div onclick="document.form_hidden.submit();"><?php echo $this->pagination->create_links(); ?></div>

 

but it's not submitting the form when the pagination links are clicked.  If I add something else in the div it works when TestTestTestTest is clicked.

<div onclick="document.form_hidden.submit();">TestTestTestTest<?php echo $this->pagination->create_links(); ?></div>

 

Arg....

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.