@Html.hiddenfor(model=>model.degree, new id = selected item by user to model.degree )
the code in the view where I want to select the value is as follow <html> <script type="text/javascript"> function qualificationSelected(selectedIndex){ document.getElementById('b').style.visibility = (selectedIndex >= 1) ? 'visible' : 'hidden'; document.getElementById('m').style.visibility = (selectedIndex >= 2) ? 'visible' : 'hidden'; document.getElementById('p').style.visibility = (selectedIndex == 3) ? 'visible' : 'hidden'; } </script> <body> <form name="myform"> <table> <tr> <td> <select name="one" onchange="qualificationSelected(this.selectedIndex)"> <option value="" selected="selected">Select...</option> <option value="1">Bachelore Degree</option> <option value="2">Master Degree</option> <option value="3">PhD</option> </select> <input type="file" id ="b" style="visibility:hidden;" /> <input type="file" id ="m" style="visibility:hidden;" /> <input type="file" id ="p" style="visibility:hidden;" /> </td><pre lang="text">
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)