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! -
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')
-
-
Html 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>
-
Javascrip 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>
-
3 1184
2inshix,
It looks like you're starting in an incorrect state - all three radio buttons are set as "checked" in your HTML.
Try setting only one to "checked" to start with.
Luck!
Oralloy
Hello, Oralloy,
Yes, you're s right! That was very silly of me wasn't it! (laughs)
That problem is solved, but there's a new issue. Once the selection is made, that selection remains persistant; meaning it won't allow a new button selection, even after a page refresh. Can you think of a quick fix just from what you see above?
Any suggestions would be greatly appreciated.
Cheers
I think your problem lies in the JavaScript bit - $("input[name='langgroup']").live("change", function() {
-
//alert($(this).val());
-
langgroup = $(this).val();
-
});
You need to verify that the correct value is being used in the assignment.
Cheers!
Oralloy
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Ross McLoughlin |
last post by:
Hey all,
Is it possible to pass a html form to a vb component, where it can be
further processed?
Thanks
Ross
|
by: Joe Ray |
last post by:
I am interested in passing encrypted HTML form data to a JSP page
where it is than decrypted. Can someone suggest a technique to do this
and the technology or encryption method I should use. If you...
|
by: HolaGoogle |
last post by:
Hi,
Sorrryy to ask such basic question but i do need your help! Here's
what i'm trying to do:
In my parent form i'm calling a my Iframe form to get certain value,
then depending on that value...
|
by: Phil |
last post by:
okay, very simple detail.... I have an HTML form which one field is a type of
"file". I am passing the value of this "file" input via a hidden form field
to an aspx page.
Can i save the file to...
|
by: Holger Butschek |
last post by:
Hi folks,
first of all, I'm absolutly new to javascript. I have designed a html-form
and am trying to path parameters with the suffix of i.e.
?Seminartitel=hallowelt in the url.
In the head...
|
by: rcmail14872 |
last post by:
I used the upsize wizard to change my Access 2002 database to a SQL
Server ADP project. I had a form where the user entered a value into a
text box and when a command button on the form was...
|
by: bp_jobemail |
last post by:
I'm trying to use PHP to wrap the output of an HTML form before it goes
into a precompiled C cgi script.
Essentially, the company that I work for uses a purchased precompiled c
program for their...
|
by: =?Utf-8?B?Um95?= |
last post by:
Hi all,
In a form I have a text called myText as input and need to pass its value to
the next page (mySecond.asp)
The following works fine and my next page I get the value of myText=test:
<a...
|
by: idsanjeev |
last post by:
SIR I AM PASSING VALUE FROM ONE FORM TO ANOTHER FORM THROUGH COOKIES BUT IS CAN ONLY TRANSFER LAST VALUE
HOW CAN PASS VALUE AFTER CLICKIN ON LINK
I AM USING THE CODE IS
FOR LINK
<td><a...
|
by: krus |
last post by:
Hi All,
I am relatively new to HTML and perl scripts. I am writing a HTML page which has a form. It takes two inputs. Now I want pass these two inputs from the HTML form to the perl script. I want...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |