passing selected radio button value from js to java

Hi all, I have two radio button yes,no in a.jsp.
var IncludeCharges = document.getElementById("IncludeCharges_no").value; If i select yes i need to pass 1 to the java file and in case of no i need to pass 0. but when i retrive the radio button value using int Includecharges = Integer.parseInt(request.getParameter("IncludeCharges_yes"); It shows undefined... How could i get the value

Posted On: Monday 26th of November 2012 11:04:01 PM Total Views:  312
View Complete with Replies

Related Messages:

passing value   (132 Views)
Is there any provision to send value from one javascript program to another javascript program. If it is possible means please reply how to do this. urgent.
Problem with passing variable   (122 Views)
i am trying to make my Ajax fetch the right My Ajax needs to fetch the value="" and send it to PHP. My ajax looks like this. var url = "uimages_class.phpalbum="; // The server-side script function handleHttpResponse() { if (http.readyState == 4) { if(http.status==200) { var results=http.responseText; document.getElementById('divCustomerInfo').innerHTML = results; } } } function requestAlbumInfo() { var sId = document.getElementById("txtCustomerId").value;"GET", url + escape(sId), true); http.onreadystatechange = handleHttpResponse; http.send(null); } function getHTTPObject() { var xmlhttp; if(window.XMLHttpRequest){ xmlhttp = new XMLHttpRequest(); } else if (window.ActiveXObject){ xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); if (!xmlhttp){ xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); } } return xmlhttp; } var http = getHTTPObject(); // We create the HTTP Object It does retrieve data to the but only the first button, in this case "Private"... Now i can see myself that its because the Ajax fetches one value by the element id "txtCustomerId", which all the generated buttons has. But how can i make the Ajax fetch a value by the button clicked Some sort of array for the "txtCustomerId" id i am really new with Ajax, would love some help.
JavaScript/HTML passing info from one form to another   (279 Views)
Hi..I am a newbie in JavaScript.I have two forms (in two different webpages) all with radio buttons. A user cannot select more than one option from each form. My plan is to pass the user input from both the forms to a perl script which would then query a MySQL db for the output and display it. Now my question is, is it possible to pass the data from first form to second using GET/POST method in Radio form Will it be possible to pass both data from first and second form to the Perl code My first form page named as index.html page and the second one is named as party_names.html. The form code I used in the first index.html page is: I have a JavaScript function to validate form data so that it can check whether a radio button is selected after clicking next button to go to next html form page. Please suggest. Many
passing parameter from javascript to php   (132 Views)
everybody m trying to pass a parameter to my controller.php from javascript but it doesn't passing and give me error of undefined URL kindly help me i shall be thankful to you...Here is my code function JSfunction(assetid) { window.location="controller.phpcommand=delete&assetid=".assetid; }
javascript passing value help   (130 Views)
s, im new to coding and i really need help for this. i have done a shopping cart calculation using javascript my question now is, HOW TO SEND JAVASCRIPT VALUE INTO DATABASE (MYSQL)        
something tells me i've nearly got it ( passing on?   (112 Views)
hi i can't seem to find the part that i'm getting wrong below, but i've narrowed it down to the bit where i'm trying to pass the querystring forward in file 2 in file 2 i'm using $_GET to grab the key from file 1, echoing it as a HTML input with an id, then i'm trying to grab it in my ajax call with getdocumentbyid and placing it into the querystring to be sent off to file 3 p.s it is a simplistic RPG action of changing equipped items- in file 1, the menu, the user's id is collected and passed onto whatever page you choose to go to in file 2, your options are displayed ( in this case, buttons are only shown for items you own). clicking on any button will equip the item, which goes to file 3 and file 3 changes the mySQL entries affected by this change and prints a text string to say what has happened. file1, menu key: result file 2- armory.php hello
passing information between pages   (136 Views)
Hii, I need help regarding information on how to pass information between two pages using javascript.In my web page,I type in the information and when i submit the information then the registration successfully happens and page gets redirected to a different web page where i need to display some of the typed in info like auto-generated user-id,username and the confirmed email id.I tried using cookies but its not producing the deed output.Document object model properties need to be used i think and tried using it also.Please anyone do provide the help if u knw....
passing functions for later use   (121 Views)
Hi Ive been using some httpRequests but have gotten tired of writing the 'preparation code' for every request... so I thought I'd make a function that accepted a URL, and a list of parameters and would return the responseText variable... But what seems to happen is that my other code continues without the ajaz call being completed... and so if I perform an operation on that responseText variable, it shows as 'undefined'... I thought if I adjusted my ajaz function to accept a function name as well which would operate on the responseText, it would solve the problem... I think Ive seen someone pass a function as an argument before... is that possible Or is there a uniform solution for avoiding writing ajax code... my ajaxCall function is below: function ajaxCall(path,querystring){ //new http request object var http; http=GetXmlHttpObject();//use another function to create the correct object var url = path; var params = querystring;"POST", url, true); //Send the proper header information along with the request http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); http.setRequestHeader("Content-length", params.length); http.setRequestHeader("Connection", "close"); http.onreadystatechange = function() { if(http.readyState == 4 && http.status == 200) { return http.responseText; } } http.send(params); } var returnContent = ajaxCall('','name=John&surname=Smith');
passing variable to modal box   (153 Views)
i have displayed a button on a page, by which a user may report anything to admin about contents complaint. when user click on this button, it leads to a new page where in a form he fills data & send to admin. now i want when user click on button, it opens modal box where he puts the data & send to admin. The probelm is how can we pass variable information associated with the button to modal box then enter this information along with form data to mysql. i have searched a lot, but could not get anything for solution. Please guide and help anybody.......
Problem passing email address through AJAX   (136 Views)
I am facing problems passing an email address to a php file through AJAX. The code I am using is pretty basic but I can't seem to get it to work. Could anyone help me understand what's going wrong I amd pretty new to Ajax (about 2 days old) so please forgive me if this seems pretty lame. function emailchk () { if (!document.getElementById("email").value) { document.getElementById("emailmsg").innerHTML = " "; } else { url = "emailchk.phpemail=" + document.getElementById("email").value; if (window.XMLHttpRequest) { xhr = new XMLHttpRequest(); } else { if (window.ActiveXObject) { try { xhr = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { } } } if (xhr) { xhr.onreadystatechange = showEmailContents;"GET", url, true); xhr.send(null); } else { alert("Sorry, but I couldn't create an XMLHttpRequest"); } return false; } } function showEmailContents() { if (xhr.readyState == 4) { if (xhr.status == 200) { var outMsg = xhr.responseText; } else { var outMsg = "There was a problem with the request " + xhr.status; } document.getElementById("emailmsg").innerHTML = outMsg; if (outMsg == "Email already exists") { document.getElementById("validate").value = "no"; } else { document.getElementById("validate").value = "yes"; } } } The PHP file is also pretty basic...
Jquery not passing variable to PHP, what's wrong with?   (101 Views)
I've an HTML table that I iterate through and grab an id column for every row that is checked. Jquery puts these values into an array that is then supposed to be passed to php post through an ajax function. The array is fine through HTTP post and Response (using Firebug). However the php post shows a null array when I do a var_dump. So in Jquery, http post and response both have populated arrays, but php's post is null. What am I doing wrong HTTP Post: idlist[] 61 idlist[] 62 Source idlist%5B%5D=61&idlist%5B%5D=62 HTTP: Response: array(1) { ["idlist"]=> array(2) { [0]=> string(2) "61" [1]=> string(2) "62" } } Jquery: $(document).ready(function() { $("#deletebut").click(function() { var msg = "You are about to delete the checked rows of the \ndatabase on the left. This will permanently erase the checked \nnames and emails. Do you want to go ahead"; var r = confirm(msg); var idlist = []; var counter = 0; if(r==true) { $("#results tr").each(function() { if($(this).find("#checkbox").is(':checked')) { idlist.push($(this).find(".idcell").html()); counter = counter+1; } }); $.ajax({ data:{'idlist':idlist}, type:'POST', cache:false, url:"http://localhost/school/desi/maintain/indexdelete.php", success: function(result,status) { if(!result) { alert("Response Status is: "+status); } else { alert("Response Succesful, Received: "+idlist); }} }); } else { alert("You have canceled, Nothing will be deleted."); } }); }); php: var_dump($_POST); php result: array(0) { }
passing form elements with Ajax in PHp with POST method   (143 Views)
i want the code of passing form elements with post in php with ajax.. i am trying a number of codes,but all in vain:( can anyone send me please, full code
passing variables to javascript   (97 Views)
It still is a dynamic field but i used a constant on the example to make sure the validation worked ;)
passing values from forms (BEGINNER)   (91 Views)
I have a web page named A.html, and this web page contains a text box called 'text1', and a button. When a user clicks the button, a pop up window appears, the name of this pop up window is B.html. B.html has a text box, and its called 'text2', and a button. The user, when he clicks on the button in A.html, the popup window which is B.html appears. and he/she will type his name in the text box of B.html (popup window). and when he clicks on the button, the popup window must close, and the entered name (in the textbox of B.html), should appear on the textbox (textbox1) of A.html. hope i made my question clear, i have been googling this for days now, and i haven't come across a solution as yet, how do i code this, can someone post some sample codes to begin
passing javascript array via ajax to phh   (212 Views)
I have a javascript array that contains only integers.I need to pass this array via AJAX as a variable. How do I convert a javascript array to a variable so that I can pass it via AJAX. On the receiving php page how do I convert back the var to an php array. I tried searching through forums for a solution but couldn't find any.
Trouble with jsf, passing event   (88 Views)
Hi folks, quick question for ya. I'm working on getting a custom context menu to work in Firefox (it was written for IE with behaviors) and I can get the menu to pop-up, but i'm getting a javascript error when it does. (Also, nothing in the menu works, but I believe that's because of some other behaviors I haven't redone). On line 4: onContextMenu="displayContextMenu" calls the function which calls a chain of functions for highlighting grid rows, getting the row id, and of course, making the contextMenu div visible. For Firefox, I've read that I need to pass the event when this is written inline like this. so I change it to this: onContextMenu="displayContextMenu(event)". This works, but I get an error: "displayContextMenu(event) is not a function" when i'm using webdeveloper addon for firefox. Also, the source code for that line looks like "displayContextMenu(event)()". So it believes "(event)" is part of the name of the function, instead of the actual event. I know they wrote this back when JSF was new, and created custom components, but is there a way to attach the event to that function call at all Thank you, Jmasta
Dynamically passing a variable to a 3rd party tracking pixel   (109 Views)
Here is what I'm dealing with. I require a way to dynamically pass a variable or value (sale amount and order id) to a 3rd party tracking pixel for my cost per sale campaign as I am using affiliate marketing. I cannot get help from Intuit who I used to design and host my site. My affiliate marketing support sent this... Just tell them you need to dynamically pass sale amount and order ID through a 3rd party tracking pixel. They should come back with a syntax for you to add to the code. It might be something like or . . . . So basically, I have the code on the confirmation page, but don't know how to dynamically pass the amount and order id so that the proper commission can be paid. Please help.
passing javascript array to ajax   (139 Views)
HI, can we pass a java script array as an argument to php using ajax request. i am trying the following code but it's not working. can any one help me pls.. java script function showCalendar() { var arr=new Array(1,2,3,4,5); alert(arr.length); xmlHttp=GetXmlHttpObject(); if (xmlHttp==null){ alert ("Browser does not support AJAX - Please update"); return; } var url="getArray.php"; url=url+"arr="+arr; xmlHttp.onreadystatechange=stateChanged;"GET",url,true); xmlHttp.send(null); } function stateChanged() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { document.getElementById("show").innerHTML=xmlHttp.responseText; } } function GetXmlHttpObject(){ var xmlHttp=null; try{ // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e){ //Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e){ xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; } php code i want to catch the array from java script. Then i want to do some stuff with array and again i want to return back that array to java script. is it possible.
passing parameter from html to javascript   (80 Views)
Hi I am having a js program which makes call to an extension number .Now i need to design a html page which is having a textbox and dial button.If we enter any number in the textbox and press the dial button,the javascript function should be called and that number entered should be called.How can i get the parameter from the html in javascript.
passing 2 values to a function then outputing results   (114 Views)
Hi Community- Im having a problem and im stuck! I am creating a rule of 72 calculator and I need to pass two seperate values to my function and display a result. So far this is what I have... Lab 4 rule 72 Amount you will deposit: Interest Rate: Total Amount of time: when I go to run the script I get an error telling me my button requires a object, but its clearly pointing to calculate(); So what am I doing wrong here The rule of 72, to make it brief, is the amount it will take to double your money. No not like those drunken calculations you make at the blackjack table at 3 a.m. but rather how long it takes from the amount deposited compared to the interest rate. EXAMPLE: If I deposit $100 @ 6% interest it would take approximately 12 years (72/6) . 72/6=12 This script is far from done but this is where I am stuck. The reason im taking in the deposit amount is so I can also display the exact amount in the end.