5 Replies - 150 Views - Last Post: 17 February 2019 - 11:24 AM Rate Topic: -----

#1 Pogaca   User is offline

  • D.I.C Head

Reputation: 7
  • View blog
  • Posts: 135
  • Joined: 24-August 13

Get data from database

Posted 17 February 2019 - 03:30 AM

Greetings,

I have issue with autocomplete by connecting with database data. For example. I have form which has autocomplete field and my task is to use that word and checkout in database table if there is any kind of that row. If there is, select it and all other fields in the form will take data from other tables (I know how to handle that query). I just need that start how to check initial autocomplete value.

HTML:

<!DOCTYPE html>

<html>

	<head>

		<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
		<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
		<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>

		<link href="style.css" rel="stylesheet">
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">

	</head>

	<body>

		<div class="wrapper fadeInDown">
  			<div id="formContent">

			    <!--Login Form-->
    			<form name="form1" >
	 				<input type="text" id="Autocomplete" class="fadeIn third" name="Autocomplete" placeholder="Autocomplete">
	      			<input type="text" id="Naslov_oglasa" class="fadeIn third" name="Naslov_oglasa" placeholder="Naslov oglasa" readonly>
      				<input type="text" id="Grad" class="fadeIn second" name="Grad" placeholder="Grad" readonly>
	   				<input type="text" id="Deo_grada" class="fadeIn third" name="Deo_grada" placeholder="Deo grada"readonly>
	    			<input type="text" id="Ulica" class="fadeIn third" name="Ulica" placeholder="Ulica" readonly>
		 			<input type="text" id="Cena" class="fadeIn third" name="Cena" placeholder="Cena" readonly>
		  			<input type="text" id="Kvadratura" class="fadeIn third" name="Kvadratura" placeholder="Kvadratura" readonly>
		   			<input type="text" id="Tip_nekretnine" class="fadeIn third" name="Tip_nekretnine" placeholder="Tip nekretnine" readonly>	
		   			<input type="text" id="email" class="fadeIn third" name="email" placeholder="Email (Obavezno polje)">
					<input type="text" id="komentar" class="fadeIn third" name="komentar" placeholder="Komentar (Obavezno polje)" >

    			</form>

    			<!-- Remind Passowrd -->
    			<div id="formFooter">
      			<button class="button" onclick="proveri()"> Pošalji Email </button>
    			</div>

  			</div>
		</div>
		<script>
			var email = document.getElementById("email").value;
			var komentar = document.getElementById("komentar").value;
			
			if (email == "") {
				alert("Unesite email");
			}
			if (komentar == "") {
				alert("Unesite komentar")
			}

		</script>

	</body>
</html>


I need javascript and php connection as autocomplete =)

Is This A Good Question/Topic? 0
  • +

Replies To: Get data from database

#2 andrewsw   User is offline

  • Stealth IT
  • member icon

Reputation: 6735
  • View blog
  • Posts: 27,712
  • Joined: 12-December 12

Re: Get data from database

Posted 17 February 2019 - 03:50 AM

What have you attempted or considered? What has your research discovered?
Was This Post Helpful? 0
  • +
  • -

#3 Pogaca   User is offline

  • D.I.C Head

Reputation: 7
  • View blog
  • Posts: 135
  • Joined: 24-August 13

Re: Get data from database

Posted 17 February 2019 - 05:06 AM

This is the task There is a field autocomplete. Let's just ignore that there will be offered word to complete. Now imagine I picked something. And click send email. As soon as i picked and sent email. All those fields will be filled by itself. So, my question is , how to get to database table from this html
Was This Post Helpful? 0
  • +
  • -

#4 andrewsw   User is offline

  • Stealth IT
  • member icon

Reputation: 6735
  • View blog
  • Posts: 27,712
  • Joined: 12-December 12

Re: Get data from database

Posted 17 February 2019 - 07:06 AM

Ajax would be a first call.

Note that we won't guide you from scratch without effort demonstrated from your part.
Was This Post Helpful? 0
  • +
  • -

#5 Pogaca   User is offline

  • D.I.C Head

Reputation: 7
  • View blog
  • Posts: 135
  • Joined: 24-August 13

Re: Get data from database

Posted 17 February 2019 - 09:05 AM

Of course. I know that :D
Was This Post Helpful? 0
  • +
  • -

#6 CTphpnwb   User is online

  • D.I.C Lover
  • member icon

Reputation: 3810
  • View blog
  • Posts: 13,849
  • Joined: 08-August 08

Re: Get data from database

Posted 17 February 2019 - 11:24 AM

In that case, why did you post HTML and Javascript but none of the PHP that processes the data?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1