I have this code which imports a file depending on user's selection (3 radio buttons romaji, hiragana,kanji)
The way it is now, checkImport() returns the last option (from handlers) no matter which button is selected. What changes Do I have to do the Javascript to activate the 3 selections? Any help will be greatly appreciated. Cheers!
Html code
Javascrip code
The way it is now, checkImport() returns the last option (from handlers) no matter which button is selected. What changes Do I have to do the Javascript to activate the 3 selections? Any help will be greatly appreciated. Cheers!
Code:
whichlang = "English" def checkImport(): if UserLogin.whichlang == "Hiragana": sys.path.append(os.path.join(config.APP_ROOT_DIR, 'srcHiragana')) return __import__('conjugateNew') elif UserLogin.whichlang == "Kanji": sys.path.append(os.path.join(config.APP_ROOT_DIR, 'srcKanji')) return __import__('conjugateNew') elif UserLogin.whichlang == "Romaji": sys.path.append(os.path.join(config.APP_ROOT_DIR, 'srcRomaji')) return __import__('conjugateNew') else :#whichlang == "English": sys.path.append(os.path.join(config.APP_ROOT_DIR, 'handlers')) return __import__('conjugateNew')
Code:
<div id="Layer-5" class="_text editable" > <input type="radio" name="langgroup" value="Romaji"checked> Romaji <input type="radio" name="langgroup" value="Hiragana" checked> Hiragana <input type="radio" name="langgroup" value="Kanji"checked> Kanji </div>
Code:
<script> $(document).ready(function() { var langgroup = "English" $("input[name='langgroup']").live("change", function() { //alert($(this).val()); langgroup = $(this).val(); }); $('#play').click( load_alerts ); function load_alerts() { var url = "/trial"; data = {"whichlang":langgroup}; $.post( url, data, post_ack_handler ); } function post_ack_handler(data, textStatus, xmlObj){ $("div#trial").html(data); if (textStatus == "error") $('#showerror').html(xmlObj.responseText); } }); </script>
Comment