In add master/details, I need to control the detail it must have a item

You may check HTTP response in your browser, see what data is posted to the server from the browser.