3

I have started writing HTML File. Which consists of dropdowns, The Second dropdown will be dependent on 1st dropdown selection and the 3rd dropdown will be dependent on 2nd dropdown so on.

I'm getting the dropdown values through a httpclient call.The response from that call will contains dropdown values of that respective dropdown.

I'm ready with HTML along with jQuery and I have fetched the response by httpclient call using rest client or java code. Now, I don't know how to integrate these.

This is my HTML Code:

<div class="form-group">
    <label class="control-label" for="typeOfSchool">Type of Educational Establishment</label>
    <div class="select">
        <select class="form-control" name="typeOfSchool" id="typeOfSchool">
            <option value=""></option>
            <option value="a">School Name 1</option>
            <option value="h">School Name 2</option>
            <option value="b">School Name 3</option>
            <option value="c">School Name 4</option>
            <option value="d">School Name 5</option>
            <option value="e">School Name 6</option>
            <option value="f">School Name 7</option>
            <option value="g">School Name 8</option>
            <optgroup label=""></optgroup>
        </select>
    </div>
</div>

The Rest Client output response Screen:

The Rest Client output response Screen:

If I select School Name 1 then based on that value I should call a httpclient. I'm done with calling httpclient from the rest client or even with java code. Struck to Integrate both in HTML.

Give me some Idea!!! Thanks in Advance.

guradio
  • 15,524
  • 4
  • 36
  • 57
Pavan
  • 135
  • 3
  • 12
  • Since you have retrieved data using JQuery, now you can append the data to the – Ajit Kumar Singh Nov 17 '15 at 10:49
  • retrieving the data using jQuery is the problem here. I have retrieved the data using java code and rest client not through jQuery. – Pavan Nov 17 '15 at 10:52
  • Time to learn Ajax. Will solve your problem in a jiffy. – Ajit Kumar Singh Nov 17 '15 at 10:54
  • Thanks I'll look into that. If you feel any other alternative, Please let me know. – Pavan Nov 17 '15 at 10:57
  • you need to use ajax – Rafik BELDI Nov 17 '15 at 11:04
  • Thank you so much. I have just started looking into ajax. It is pretty Awesome. I hope it might take a day or two but i got hope now. Thanks All, Love you All. – Pavan Nov 17 '15 at 11:07

1 Answers1

0

To add or call the java code from HTML file, you can use Applet

Keurdange
  • 1
  • 2
  • Yeah we can call Java code even by writing onchange event to that drop down and we have to call that java code from that function. Even We can do this using Applet as you said. Thanks for that. But my intention is that to write that httpclient code i.e, java code in the same file which makes my output or loading of next dropdown quickly. – Pavan Nov 17 '15 at 10:46