Handle the indexerror exception on create_order

LMS-2646
Becuuse we need to append only those values to form which are valid whereas in promise it will append values to form every time we made the ajax call.