Welcome Guest, Not a member yet? Register   Sign In
conditional set_value()
#3

Depending on how many fields you want to keep compared to how many you want to resubmit, you could use a redirect to the same page. A redirect will reset the post fields. You would just send the additional details in the function arguments, and set those as the defaults for the form view.

Alternatively, perhaps the functionality should be redesigned. So if they are giving their name, postcode, password, username for example, plus some address details, say, and it is the address details that are being resubmitted, then I would have another screen entirely for adding more addresses. ie not re-displaying the same page. This stops the user from accidentally changing some of the info originally sent.

Alternatively you can manually set an array (all blank initially) that you use for the field values, rather than using set_value. Then overwrite those field values with submitted values for refilling, and then overwriting the 'to be blanked out' submitted values again if successfully validated and re-sending for the 'submit another' version of the screen. I would not do this myself but you could do it this way.

I suppose that all depends on your exact functionality. If you provide some details of the fields perhaps a better suggestion can be made.

Personally I would use two forms. One for the initial send and one for the submit another. You can then easily have different instructions, layouts and buttons for different options on the resubmit, and use that form again should the user later want to add another of whatever it is you are adding in your example.
Reply


Messages In This Thread
conditional set_value() - by dbrooke - 10-07-2016, 02:09 PM
RE: conditional set_value() - by RogerMore - 10-10-2016, 02:09 AM
RE: conditional set_value() - by PaulD - 10-10-2016, 04:22 AM
RE: conditional set_value() - by dbrooke - 10-10-2016, 08:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB