I am trying to output students name from database and input field to enter result based on drop down selection of class and subject
Asked
Active
Viewed 124 times
-2
-
I am trying to output students name from mysql databse and input field to enter result based on dropdown selection of class and subject. the drop downs are SUBJECT, CLASS, RESULT CATEGORY – Adeniyi Ariyo Mar 30 '17 at 13:13
-
You could use JavaScript to alter the target of the form containing the drop-down selection list. You could use server-side scripting and send redirect in a header field based on the submitted values from the drop-down selection list. There are hundreds of other solutions. – kainaw Mar 30 '17 at 13:14
-
you posted no code and what you tried. This should be relatively easy. – Funk Forty Niner Mar 30 '17 at 13:14
-
pls fred can you help me out with a sample code ...still learning how to post code in this platform – Adeniyi Ariyo Mar 30 '17 at 13:15
-
Show us some code. what have you tried so far.. – Shakti Phartiyal Mar 30 '17 at 13:16
-
There are too many possible answers for this. Your question is both unclear and too broad. – Funk Forty Niner Mar 30 '17 at 13:22
-
There are many ways to accomplish the task you have set. You need to give us more information so that we know you are not just expecting us to write it for you. To post code you can click the `code` tag button and then paste code into the resulting `enter code here` block or you can take the code that you have and format it so that each line is at least 4 spaces indented and then paste that directly to your question with an empty line between your code and the question above it. In order to help we have to have details and know what you have already tried. – Mike Mar 30 '17 at 13:28
1 Answers
-2
function ridectMe(){
/*get the data choose*/
var std = $("#test").val();
/*you can see the value has been choose*/
alert("selected : "+std);
/*if you want to redect the pages, u can use */
window.location.href="https://localhost/index.php?id="+std+"";
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<select id="test" onchange="ridectMe()">
<option value="test1">student 1</option>
<option value="test2">student 2</option>
<option value="test3">student 3</option>
</select>

Mas Ai
- 43
- 6
-
1While this code may answer the question, providing additional context regarding why and/or how this code answers the question improves its long-term value. This is the second time you have been advised about this today. – Jay Blanchard Mar 30 '17 at 13:31
-
Thank you for your advice @JayBlanchard :), i just a new user and my speak english is not very well, but i will try to add additional context regarding why my code answers the question. thanks alot for your advice . – Mas Ai Mar 30 '17 at 14:36