0

Hi every one, I have problem need help that, I have a form have 1 select filed and 1 text field, I want when I choose value in option of select the text field will load/appear value in proportion to value of select, example in picture when I choose "B" in select field, the value in text filed will appear "1", so how to do it, I need example to refer, guide or demo example, Thank for read my topic.

Here is Image:

http://i1095.photobucket.com/albums/i472/OLAKEN91/gdf_zpsac464e04.jpg 

Code:

<head>
<title>Untitled Document</title>
<style type="text/css">
</style>
</head>
<body>
    <center>
    <br />
    <form id="cv" action="" method="">
        Choose Option: <select id="chedo">
        <option>--Choose Value--</option>
        <option>A</option>
        <option>B</option>
        <option>C</option>
        </select>
        <br />
        <br />
        Value: <input type="text" id="lenh" size="40"/>
        <br />
        <br />
        <input type="submit" value="SUBMIT"/>
    </form>
    </center>
</body>
</html>
2
Contributors
1
Reply
15
Views
3 Years
Discussion Span
Last Post by diafol
0

Does this have to be php? It sounds more like a js solution.

<form id="cv" action="" method="">
    Choose Option: 
    <select id="chedo">
        <option value="">--Choose Value--</option>
        <option value="1">A</option>
        <option value="2">B</option>
        <option value="3">C</option>
    </select>

You can't run php on a loaded page, unless you use Ajax. So it's js unless you want to reload the page every time you select an option

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.