|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Java Form
I have a form written in html but its controlled by javascript. Form basically updates a graph according to the selected fields by the user.
on the same page i have another script which needs to use one or two values from the selected fields. the only way to do is to display the form values in the address bar, so that other script can take it from there. the problem is that java collects the form values and processes the graph but it doesnt display the form values in the adress bar. is there a way to display those values in the address bar? example : mathgraph.php?x=12&y=34&lenght=60....etc here is the java code <SCRIPT LANGUAGE="Javascript"> //Cross browser method to get an object function getObject(id) { if (document.getElementById) //IE 5.x or NS 6.x or above return document.getElementById(id); else if (document.all) //IE 4.x return document.all[id]; else //Netscape 4.x return document[id]; } //Update the chart according to user selection function updateChart() { // //we encode the values of all form elements as query parameters // var elements = getObject("Form1").elements; var url = "mathgraph.php?"; for (var i = 0; i < elements.length; ++i) { var e = elements[i]; if (e.type == "checkbox") url = url + e.id + "=" + (e.checked ? "1" : "0") + "&"; else url = url + e.id + "=" + escape(e.value) + "&"; } //Now we update the URL of the image to update the chart getObject("ChartImage").src = url; } </SCRIPT> Thank you, |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > Java Form |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|