|
Title: Updating Form fields after submission Post by: peter900 on April 24, 2016, 03:12:17 PM I am exploring how EUI forms could be used for volume data input. I want to be able make changes to the fields after a submission in readiness for the next entry. For example, to retain some fields, to blank others and to allow some manipulation such as running an incrementing counter.
I thought it might be possible to do something in the success: routine. But this doesn't work. Code: $(function(){Any help to point me at some sample code to do something along these lines would be much appreciated. Thanks. Title: Re: Updating Form fields after submission Post by: peter900 on April 28, 2016, 04:38:38 AM The solution to updating a form field after submission, for example setting the name field to "", is:
$('input[name="name"]').val(""); [ To retrieve a field value use var email = $(“myfield“).val(); where myfield is an id. ] Here is a trivial example of using a php function ( in this case just returning server time ) to place a value directly into a form field - not actually an EasyUI form in this case but the principal is the same for all jQuery forms. Code: <html> Here is the code in post_receiver2.php Code:
This means that, in a volume input situation, it is possible to retain selected field values and update read only fields with values drawing on php power. |