Is it Possible to get values from java to php??????? or How can i get the value of a radio button instantly without redirecting or submitting?? when the user clicked on a radio button, php gets the radio buttons correponding value and display it. is it possible?? huhu i've been working for this all night, i've got no sleep TT_TT can someone help me pls??? thanks in advanz ((((
I assume this relates to your other post? PHP is server side and Javascript is client side. So by the time the browser renders all the html, javascript etc, it's done all the serverside processing within PHP. Hence you can not use Javascript to talk to PHP without reloading the page or using Ajax to prompt another request to the server.
If you want to use PHP, like mfscripts said, you'll have to use ajax. However, for something as simple as displaying the value of the radio button, you can just use Javascript anyway.
I've tried to do this too. I've stumbled upon the solution once, but I cannot find it again. They use javascript and ajax. If you were lucky, you might be able to find it.
ohh thanks guyz, i think it is really impossible to do that ( i have a pop-up from which when the radio button is clicked and the "validate this client" button is clicked the pop-up will appear --i was hoping that the pop-up will be able to get the value of the clicked radio button i guess this is really impossible ((
Well, I assume you're talking about JavaScript, in that case, yea, it is possible: using jQuery, you can achieve this easily, for example: $.post("mypage.php", {radio1: "val"}, function(data){ $("#response").html(data); }); What this does, for example, is to make an HTTP request, using POST method, with the query string of ?radio1=val, and return the response back, using a callback function. If you want to do this via Java (eg. the OOP Language), you'll need to go the same route of using an HTTP Request, but it's a bit more complex, and you can use the appropriate libraries, documentation is avaible, I believe in oracle.
thnx ill give it a try hmmmm... is there a way to refresh a php page, by clicking a popup window button? it should refresh before the pop up window appears
Just to save you a headache down the road... JavaScript should be referred to as JavaScript NOT Java. Java is a programming language and should NOT be confused with the client side scripting language JavaScript.
hi this is possible you can try with this. <form name="test"> <input type="radio" id="chk" name="chk" value="set" onClick="setValueInDiv(this);"> to check <div id="setHTML"> </div> </form> <script> function setValueInDiv(obj){ if(doucment.test.chk.checked){ document.getElementById('setHTML').innerHTML=doucment.test.chk.value; return true; }else{ document.getElementById('setHTML').innerHTML='please select the ration button'; return false; } } </script>
There might be, if there were such a thing as a PHP page, but there isn't. PHP is used to generate a page that's HTML, Javascript and CSS. A page, not two pages at once (which is what you're asking about).