3
Contributors
7
Replies
8
Views
7 Years
Discussion Span
Last Post by sugikrish
0
<html>
<script lang='javascript'>
function onselectchange()
{
        document.formname.textboxname.value = document.formname.selelistname.options[document.formname.selelistname.selectedIndex].text;
}
</script>
<form name=formname>
<input type=textbox name=textboxname id=textboxname  >
<select name=selelistname onchange='javascript:onselectchange();'>
<option value='1'/>one
<option value='2'/>two
<option value='3'/>three
</select>
</form>
</html>

Edited by urtrivedi: n/a

0

i want to create cart system in php. it need maintain invoice number. customer select many items each time they click "add to cart". When they click "finish purchase" then only invoice number wil be increment. how to do this..

0

You might find this

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta name="generator" content=
    "HTML Tidy for Windows (vers 25 March 2009), see www.w3.org">
    <title></title>
  </head>
  <body>
    <form name='frm1' id="frm1">
      <input type="text" name="box1"> 
      <select id='sel1' onchange='document.frm1.box1.value=this[selectedIndex].text'>
        <option value='1'>
          one
        </option>
        <option value='2'>
          two
        </option>
        <option value='3'>
          three
        </option>
      </select>
    </form>
    <script type="text/javascript">
        var oTmp = document.getElementById('sel1')
        document.frm1.box1.value=oTmp[oTmp.selectedIndex].text
    </script>
  </body>
</html>

more useful. It sets the initial value (and the html passes validation).

0

i want to create cart system in php. it need maintain invoice number. customer select many items each time they click "add to cart". When they click "finish purchase" then only invoice number wil be increment. how to do this..

Try the PHP forum.

0

ya i try this. its working. i have one more doubt. values from list to text box successfully working. using this value can we retrieve data from database and displayed in another text box. u cant understand na i will send screen shot.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.