diff --git a/js/recherche.js b/js/recherche.js index b499c5478f08c94af9fae7d7e74d5f38f0ca41fe..eace6c168c7fe386671dd7ea1785e368d5831ccb 100644 --- a/js/recherche.js +++ b/js/recherche.js @@ -36,6 +36,11 @@ else if (document.getElementById("radio_2").checked == true) { API = "youtube-api" } + else { + document.getElementById("erreur").innerHTML = "Please select a social network."; + return 0; + } + document.getElementById("erreur").innerHTML = ""; xhttp.open("GET", "../"+API+"/userSuggestions.php?w="+keyword, true); xhttp.send(); } diff --git a/page_welcome/index.php b/page_welcome/index.php index ac2cbb143990f9ce6e144bd6f6f36443e897bf89..87d4d04f286a8dc5658b0d3914b399c85655372b 100644 --- a/page_welcome/index.php +++ b/page_welcome/index.php @@ -33,11 +33,10 @@ session_start(); </h3> <div class="search-agile"> <div> - <!-- <input type="submit" value="Search"> --> <div style="display: inline-flex;"> - <input class="img" type="radio" id="radio_1" name="radio[]" value="1" onchange="showSuggestions();"/> - <label for="radio_1"><img src="../images/ins.png" width="50" height="50"/></label> + <!-- <input class="img" type="radio" id="radio_1" name="radio[]" value="1" onchange="showSuggestions();"/> + <label for="radio_1"><img src="../images/ins.png" width="50" height="50"/></label>--> <input class="img" type="radio" id="radio_2" name="radio[]" value="2" onchange="showSuggestions();"/> <label for="radio_2"><img src="../images/youtube.jpeg" width="50" height="50"/></label> @@ -45,8 +44,8 @@ session_start(); <input class="img" type="radio" id="radio_3" name="radio[]" value="3" onchange="showSuggestions();"/> <label for="radio_3"><img src="../images/twitter.png" width="50" height="50"/></label> - <input class="img" type="radio" id="radio_4" name="radio[]" value="4" onchange="showSuggestions();"/> - <label for="radio_4"><img src="../images/facebook.png" width="50" height="50"/></label> + <!-- <input class="img" type="radio" id="radio_4" name="radio[]" value="4" onchange="showSuggestions();"/> + <label for="radio_4"><img src="../images/facebook.png" width="50" height="50"/></label>--> </div> <input id="searchField" style="height: 50px; font-size: 20px;" list="usernames" name="username" type="text" size="40" maxlength="100" autocomplete="off" placeholder="Search here..." onkeyup=" if (this.value === '') { @@ -59,7 +58,7 @@ session_start(); </datalist> - <div class="clearfix"> </div> + </div> </div> @@ -68,6 +67,8 @@ session_start(); <div id="suggestionButtons"> </div> + <div id="erreur" style="height: 50px; font-size: 20px; color: white;width: 255px; margin:auto; "> </div> + </div> </div> </li>