In a form, I have 4 select boxes(default), and two text boxes(default).

If I click the first (static values) based on that next second(new) select box will come (it has been done by ajax), based on the new select box, I display checkboxes based on the select box values, if i click the checkboxes i will show the related list in the select box. These all are achieved by ajax.

Rest of the 3 out of 4 and two text boxes will be filled next.After that I will submit, then it will save in db and will show the values in table from db in the same page itself. To save these values I passed it to new page in jquery ajax.

My query is, After submitting the page will refresh, and the field values are displaying like new page. But I want to display what are the field values that has been selected when I do in first time.
But I am not doing Edit page.
My aim is, Each eand every time I do not want to enter again in the that fields, but I may change the values next time , for next inserting.

3 Years
Discussion Span
Last Post by Gideon_1

You have two options:

1) Ajax instead of a form post. This way, the page never refreshes.
2) The form page will need to consume the previous form post, and set the values to match the incoming data - basically, setting the values on page load after a submit.

example (PHP-ish):
<input type="text" name="Name" value="<?echo ($_POST['Name']);?>" />


I also agree on the ajax concept but let me throw light on this point.
You can change the input type="submit" to input type="button" and give the form no action and method.

So on the button you use the event handler, onClick then ajax.

If the data is sensitive then its advisable to make the asynchronous connection in a post form not a get.

xml.http ('POST', 'your_form_file.php', true);

I hope it helped.

Edited by Gideon_1: error correction


@Gideon_1: He says he's using jQuery

Votes + Comments
@diafol, that escaped me though
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.