javascript - rendering a list of varying length in html page -


hi need render list of objects(eg. hotels) in html page , user should select hotel hotel id should posted controller, length of list not fixed let n, thought of creating n radio boxes realized html doesn't support loops, , don't know if possible create forms within javascripts

note i'm using play framework in application

any in advance

this basic concept of how iterate on object , print out html. not perfect, not need, starting point.

var hotels = ['best western','hilton','super 8']; for( var i=0; i<hotels.length; i++ ) {     document.write( '<input type="radio" name="hotels" id="' + + '" />' + hotels[i] ); } // 

in action


Comments