Jump to content

onchange function will change the value of php


sunilpaladugu

Recommended Posts

Hi alll

 

I have the below issue

 

I have one text box and

one dropdown box(select box) in php

 

my drop down list like

<select name="some">

<option value"00">zero</option>

<option value"11">non-zero</option>

</select>

 

if i am selecting the option "zero",the value of "zero" i.e, "00" need to be show in the textbox as a value

 

 

can anybody help me to solve

 

thanks in advance

 

 

 

 

 

 

 

 

 

 

 

 

 

This is not php it's javascript, because you would need a submit button to do in without it.

and it's not onchange it's onclick. If you want this done in php use forms with a submit button and call the php file.

<html>
<head>
<script type="text/javascript">
function me(thing){
document.getElementById('showHere').innerHTML = thing;
}
</script>
</head>
<body>

<select>
<option>Choose One</option>
  <option onclick="me('00');">zero</option>
  <option onclick="me('11');">non-zero</option>
</select>
<br /><br /><br /><br />
<div id="showHere" >Watch this space</div>
</body>
</html>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.