Casperownz
New Member
I got an aspx page with HTML controls,Based on the button click function I want to change the visibility of controls.If user clicks on EDIT,I want to disable the controls otherwise (NEW) enable the controls.Please suggest me in doing this.Javascript:\[code\]function btnNewSystem() {var obj = new Object();// Show the child formshowModalDialog('/_system/ViewSystem.aspx?mode=New&randval=' + Math.random(), obj, 'dialogHeight: 800px; dialogWidth: 900px;');\[/code\]}\[code\]function btnEditSystem() {var obj = new Object();// Store the hidden value & text fields into variablesvar hdnSelectedValue = http://stackoverflow.com/questions/15482191/document.getElementById('hdnSelectedValue');var hdnSelectedText = document.getElementById('hdnSelectedText');// Show the child formshowModalDialog('/_system/ViewSystem.aspx?mode=Edit&SystemId=' + hdnSelectedValue.value + '&randval=' + Math.random(), obj, 'dialogHeight: 800px; dialogWidth: 900px;');\[/code\]}ASPX Page://aspx page path//'/_system/ViewSystem.aspx\[code\] <div class="FormSectionContent"> <table width="100%" cellpadding="3px" cellspacing="0"> <colgroup> <col width="115px" /> <col width="*" /> </colgroup> <tr> <th><label>System Name</label></th> <td><input id="tbsystemName" type="text" style="width:100%" value="http://stackoverflow.com/questions/15482191/System Name Here" /></td> </tr> <tr> <th><label>Package Type</label></th> <td><select id="ddlselectedPackageType" style="width:100%" disabled = "disabled" ><option value="http://stackoverflow.com/questions/15482191/1">- Please select a Package type -</option><option value="http://stackoverflow.com/questions/15482191/Guest">Guest</option><option value="http://stackoverflow.com/questions/15482191/Host">Host</option></select></td> </tr> <tr> <th><label>Version Type</label></th> <td><select id="ddlselectedVersion Type" style="width:100%" disabled = "disabled"><option value="http://stackoverflow.com/questions/15482191/2">- Please select a Version type -</option><option value="http://stackoverflow.com/questions/15482191/Full">Full</option><option value="http://stackoverflow.com/questions/15482191/Partial">Partial </option></select></td> </tr> <tr> <th><label>Size</label></th> <td><select id="ddlselectedSize" style="width:100%" disabled = "disabled"><option value="http://stackoverflow.com/questions/15482191/3">- Please select a system size -</option><option value="http://stackoverflow.com/questions/15482191/Single">Single</option><option value="http://stackoverflow.com/questions/15482191/Double">Double</option></select></td> </tr> </table> </div>\[/code\]Buttons:\[code\] <input id="btn1" type="button" value="http://stackoverflow.com/questions/15482191/EDIT" onclick="btnEditSystem();" /> <input id="btn2" type="button" value="http://stackoverflow.com/questions/15482191/NEW" onclick="btnNewSystem();" />\[/code\]