If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

I am trying this:
1. When visitor enter his roll number in field 1, suppose he enter 1
2. Then subject field automatically changes to English subject for roll no.1 and similarly if visitor enter roll no.2 then subject auto changes to Math. and so on.

In this way i want visitor a simple way to deal with this form by avoiding selection of subject from dropdown manually. I know this can be possible with javascript, so i need help here.

Yes, user just need to enter his roll number in the text box and by some javascript subject automatically selected according to the roll number entered. Basically i want to make a relationship between text box and select box using some javascript.

And yes i am using php for form submission. Please help me how to do that?

you asked a question and got the answer. no one here knows your goals better that you yourself. do you really need this <select> element? it is not clear what are you trying to get as the result. there may be another way to achieve this, if you describe your goal in details

The above html code was an test data to get some idea. Below is my html code with javascript in file .js as included in head:
<!DOCTYPE html>
<html>
<head>
<script src="http://sms24x7india.com/mobiledata.js" type="text/javascript"></script>
</head>
<body>

My Goal:
When user enter a 10 digit number in the text field say 9999999999 then a select box will auto-select a service provider according to text field data entered. Similarly another select box below it auto-select the state based on data entered in text field.

Currently, i can show all the data outside the select box when user enter a 10 digit number in text field and click on button.
This is the exact live example a website using that i want am trying to do:https://www.paytm.com/
(In this site when you enter 9999999999 in the text field then mobile operator select box auto-select to "Vodafone")

as far as i can suppose, this is not the only text field and select element question. looking into the page source you can see <script src="/js/jquery-1.5.2.min.js"></script> and that makes me think that the answer may be found somewhere in <script src="/js/min/daa327a34ce614eafa7328d45de111c7.js" defer="defer"></script> linked script which full address is _https://www.paytm.com/js/min/daa327a34ce614eafa7328d45de111c7.js

I tried to find exactly how it is working but no success. I know there is function called in input onchange function "populateoperator" but in .js file, there is no such function. I had also copied the source code here:http://sms24x7india.com/paytm.html
(But its not working)