Hi,
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.

Recommended Answers

All 7 Replies

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']);?>" />

you should definitely be using ajax for this kind of page

ok but. it seems like editing. IF I do the same while editing how to do?

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.

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

I hope it helped.

Member Avatar for diafol

@Gideon_1: He says he's using jQuery

commented: @diafol, that escaped me though +2

I have no idea.Tell me any one

Any idea of?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.