View Full Version : Javascript function return value ... how to use that

09-04-2007, 07:13 AM

I created one drop down list box with enable and disable options. if enable is selected and click submit then it has to display 'changed from disabled', for this I wrote one javascript function with this, if I want to display the value on the text box then it is working fine. But I am not able to display the same value in the table. I am send the sample code here...

plz see below commented code is to display the value in the text box. Now I am tring with the table option. I have to display these values in the table anyhow. Any one plz help me. I stuck here...

<title> example</title>
<script type="text/javascript">
function moveNumbers()
var no=document.getElementById("no")
var option=no.options[no.selectedIndex].text
var txt=document.getElementById("result").value
if (option =="Enable")
var tt="Changed from Disable"
tt="Changed from Enable"


<table border=2>
<td> <select id="no">
<td id="result"> </td>
<input type="button" onclick="moveNumbers()" value="Submit">
<!--<input type="text" id="result" size="20"> <!--commented code-->
<table border=2>
<tr><th id="result">hai</th>
</table> -->

09-04-2007, 07:55 AM
Try .innerText instead of .value.