0

My form will submit data and get a result on the same page to the user for only viewing. The result will not save any where. my image form is here

As above image select 2 parameter which save on Db and 1 length which is temp .

On select length after submit.
On submit below table will show result in table as type ,volatage .,resultR,resultX,resultB to user.

length,resultR=lengthr,resultX=lengthx,resultB=length*b all three are temp array. user can do many time for result and shown row by row and on clear click all result will erase.

Insane Skull
  • 9,220
  • 9
  • 44
  • 63

1 Answers1

0

I think one way to do it is to keep a div which acts as a container for all the results in the second table. You can the save the result you got from the submit and append that data to the second tables div.Something like this:

$("#second-table-div table").append('<tr><td>resultR : '+somevalue+'</td><td>...</td></tr>');

Once the user clicks 'clear' button, you can simply write a small jquery or javascript, something like this:

$('#clear').on('click',function(){
  $("#second-table-div").html('');
});
dvenkatsagar
  • 936
  • 7
  • 22
  • thanks but you have any demo this type because i m new in yii .If you have then send it – jaydeep kateshiya Jan 29 '16 at 08:36
  • Actually its not related to yii, you can achieve it using pure javascript or jquery. I dont have any demo, but if you can provide a sample code of what you did, I might be able to change that. – dvenkatsagar Jan 29 '16 at 08:39
  • i want simple as take value from form as length and r value from type table then result=r * length .In below it show but not save in db.i dont know how to do – jaydeep kateshiya Jan 29 '16 at 08:46
  • ya its totally javascript only – jaydeep kateshiya Jan 29 '16 at 08:46
  • You dont need to save it in the db, once you submit, you can access the data(methods available online). Do the calculations of the values and create DOM table using jquery/js (methods available online), then you use the above solution to append the data to second table. – dvenkatsagar Jan 29 '16 at 08:51