Skip to Content
Menu
This question has been flagged
2 Replies
3059 Views

please help me somebody.

Avatar
Discard
Author

if select input field ...based on this input another input filed value has to be changed how to do this ...plz help me

Best Answer

Hi,
Please try the following code:
I have a input date field in the XML file as given below

<input type="date" class="fa fa-plus-square " id="date_to"/>
<script>
$(document).on("change", "#date_to", function (){
//perform operations here
});
</script>
It may help you.
Avatar
Discard
Author

in function how do i take odoo model records

Author

i am not able to get odoo model records

plz check my javascript code

<input type="text" class="fa fa-plus-square " id="course_dropdown"/>

<script>

$(document).on("change", "#course_dropdown", function (){

odoo.define("portal_student.registration", function (require) {

var rpc = require('web.rpc');

var course = document.getElementById("course_dropdown");

rpc.query({

model: 'op.batch',

}).then(function (data) {

for(i in data){

document.getElementById("batch_id").value = i.name;}

});

});

}

</script>