i want to autofill some column based on id in add forum
autofill
- Single Page
Posted 15 February 2018 - 07:33 AM
Posted 16 February 2018 - 03:53 AM
i am confused on the same - add form dose not have any id.. so how you plan to set values .,.and on what basis?
Posted 22 February 2018 - 06:14 AM
i have one table with id and other table with price if i type id or select it from dropdown it should autofill the price field
Posted 23 February 2018 - 05:10 AM
Steps to achieve the same:
1. Have to write a script in a JS file which will handle the on change event for the drop down (the source element)
2. In script - make Ajax call to retrieve the price based on the value of selected element.
3. Write a action in controller to retrieve and send back the price / output to the request
4. In the success function for the ajax call - set the value of the field with the element retrieved from the ajax request.
1 more important info - add the js in action using set_js function ...
and in the js - call for window.onload function and not $.ready - the $.ready will fail...
That's the way u do it..
Happy GCing :)
Posted 23 February 2018 - 10:27 AM
thanks i ll try dis
can u send any examples