Form posts unwanted commas to database

Using asp.net in Webmatrix I created a drop menu where you select a state, and then based on that choice there is another drop menu for the user to select a region within that state.The problem I am having is when the data is posted it will add a bunch of commas for the other regions not selected. I can see how this is happening, each select tag for region has name="Region", however I don't know how to fix this, the div tag they are all nested in I can't use the 'name' attribute for. Without a name somewhere the region field nothing gets posted to the database.Here is the html code:\[code\]<label>State:</label> <select class="stareg" id="SelectState" name="State" size="1"> <option value="">Please Select</option> <option value="http://stackoverflow.com/questions/13786979/ACT">A.C.T.</option> <option value="http://stackoverflow.com/questions/13786979/NSW">New South Wales</option> <option value="http://stackoverflow.com/questions/13786979/NT">Northern Territory</option> <option value="http://stackoverflow.com/questions/13786979/QLD">Queensland</option> <option value="http://stackoverflow.com/questions/13786979/SA">South Australia</option> <option value="http://stackoverflow.com/questions/13786979/TAS">Tasmania</option> <option value="http://stackoverflow.com/questions/13786979/VIC">Victoria</option> <option value="http://stackoverflow.com/questions/13786979/WA">Western Australia</option> </select> <label>Region:</label> <div id="SelectRegion"> <div> <div> <select class="stareg" name="Region"> <option value="">Please Select</option> </select> </div> </div> <div id="VIC" style="display: none;"> <div id="VICReg"> <select class="stareg" id="VICRegs" name="Region"> <option value="">Please Select</option> <option value="http://stackoverflow.com/questions/13786979/Melbourne & Inner Suburbs">Melbourne & Inner Suburbs</option> <option value="http://stackoverflow.com/questions/13786979/East & South East">East & South East Suburbs</option> <option value="http://stackoverflow.com/questions/13786979/Geelong">Geelong</option> <option value="http://stackoverflow.com/questions/13786979/Gippsland">Gippsland</option> <option value="http://stackoverflow.com/questions/13786979/Mornington Peninsula">Mornington Peninsula</option> <option value="http://stackoverflow.com/questions/13786979/North & West Suburbs">North & West Suburbs</option> <option value="http://stackoverflow.com/questions/13786979/Yarra Valley & Dandenong Ranges">Yarra Valley & Dandenong Ranges</option> <option value="http://stackoverflow.com/questions/13786979/Regional Victoria">Regional Victoria</option> </select> </div> </div> <div id="NSW" style="display: none;"> <div id="NSWReg"> <select class="stareg" id="NSWRegs" name="Region"> <option value="">Please Select</option> <option value="http://stackoverflow.com/questions/13786979/Sydney & Inner Suburbs">Sydney & Inner Suburbs</option> <option value="http://stackoverflow.com/questions/13786979/Central West">Central West</option> <option value="http://stackoverflow.com/questions/13786979/Hunter">Hunter</option> <option value="http://stackoverflow.com/questions/13786979/North Coast">North Coast</option> <option value="http://stackoverflow.com/questions/13786979/South Coast">South Coast</option> <option value="http://stackoverflow.com/questions/13786979/Southern Inland">Southern Inland</option> <option value="http://stackoverflow.com/questions/13786979/Western Sydney">Western Sydney</option> <option value="http://stackoverflow.com/questions/13786979/Regional N.S.W.">Regional N.S.W.</option> </select> </div> </div> <div id="QLD" style="display: none;"> <div id="QLDReg"> <select class="stareg" id="QLDRegs" name="Region"> <option value="">Please Select</option> <option value="http://stackoverflow.com/questions/13786979/Brisbane & Inner Suburbs">Brisbane & Inner Suburbs</option> <option value="http://stackoverflow.com/questions/13786979/Bundaberg">Bundaberg</option> <option value="http://stackoverflow.com/questions/13786979/Cairns">Cairns</option> <option value="http://stackoverflow.com/questions/13786979/Gold Coast">Gold Coast</option> <option value="http://stackoverflow.com/questions/13786979/Mackay">Mackay</option> <option value="http://stackoverflow.com/questions/13786979/Sunshine Coast">Sunshine Coast</option> <option value="http://stackoverflow.com/questions/13786979/Townsville">Townsville</option> <option value="http://stackoverflow.com/questions/13786979/Regional QLD">Regional QLD</option> </select> </div> </div> <div id="SA" style="display: none;"> <div id="SAReg"> <select class="stareg" id="SARegs" name="Region"> <option value="">Please Select</option> <option value="http://stackoverflow.com/questions/13786979/Adelaide & Inner Suburbs">Adelaide & Inner Suburbs</option> <option value="http://stackoverflow.com/questions/13786979/Adelaide Hills">Adelaide Hills</option> <option value="http://stackoverflow.com/questions/13786979/Barossa">Barossa</option> <option value="http://stackoverflow.com/questions/13786979/Clare Valley">Clare Valley</option> <option value="http://stackoverflow.com/questions/13786979/Eyre Peninsula">Eyre Peninsula</option> <option value="http://stackoverflow.com/questions/13786979/Fleurieu Peninsula">Fleurieu Peninsula</option> <option value="http://stackoverflow.com/questions/13786979/Kangaroo Island">Kangaroo Island</option> <option value="http://stackoverflow.com/questions/13786979/Limestone Coast">Limestone Coast</option> <option value="http://stackoverflow.com/questions/13786979/Murraylands">Murraylands</option> <option value="http://stackoverflow.com/questions/13786979/Yorke Peninsula">Yorke Peninsula</option> <option value="http://stackoverflow.com/questions/13786979/Regional S.A.">Regional S.A.</option> </select> </div> </div> <div id="WA" style="display: none;"> <div id="WAReg"> <select class="stareg" id="WARegs" name="Region"> <option value="">Please Select</option> <option value="http://stackoverflow.com/questions/13786979/Perth & Inner Suburbs">Perth & Inner Suburbs</option> <option value="http://stackoverflow.com/questions/13786979/Great Southern">Great Southern</option> <option value="http://stackoverflow.com/questions/13786979/Peel">Peel</option> <option value="http://stackoverflow.com/questions/13786979/South West">South West</option> <option value="http://stackoverflow.com/questions/13786979/Regional W.A.">Regional W.A.</option> </select> </div> </div> <div id="ACT" style="display: none;"> <div id="ACTReg"> <select class="stareg" id="ACTRegs" name="Region"> <option value="">Please Select</option> <option value="http://stackoverflow.com/questions/13786979/Canberra & Inner Suburbs">Canberra & Inner Suburbs</option> <option value="http://stackoverflow.com/questions/13786979/Other Area A.C.T">Other Area A.C.T</option> </select> </div> </div> <div id="TAS" style="display: none;"> <div id="TASReg"> <select class="stareg" id="TASRegs" name="Region"> <option value="">Please Select</option> <option value="http://stackoverflow.com/questions/13786979/Hobart & Inner Suburbs">Hobart & Inner Suburbs</option> <option value="http://stackoverflow.com/questions/13786979/Davenport">Davenport</option> <option value="http://stackoverflow.com/questions/13786979/Launceston">Launceston</option> <option value="http://stackoverflow.com/questions/13786979/Regional Tasmania">Regional Tasmania</option> </select> </div> </div> <div id="NT" style="display: none;"> <div id="NTReg"> <select class="stareg" id="NTRegs" name="Region"> <option value="">Please Select</option> <option value="http://stackoverflow.com/questions/13786979/Darwin & Inner Suburbs">Darwin & Inner Suburbs</option> <option value="http://stackoverflow.com/questions/13786979/Regional N.T.">Regional N.T.</option> </select> </div> </div></div>\[/code\]And here is the jquerry script:\[code\] $(function () {$('#SelectState').change(function () { $('#SelectRegion > div').hide(); $('#SelectRegion').find('#' + $(this).val()).show();});\[/code\]});Everything works how I want except for the additional commas sent to the database. Is there a way to wrap all the region select tags with the one name, or will it require some more advanced scripting? Any help will be much appreciated.
 
Back
Top