• 10-11-2016, 05:13:05
    #1
    Merhaba arkadaşlar.
    Aşağıda resimini de yüklediğim gibi bir text alanına yazılan yazıyı belirli bir urlnin sonuna ekleyecek, butona tıklandığında sayfayı o url ye yönlendirecek javascript lazım. Eğer text alanı boş ise uyarı verecek.
    ücretli ücretsiz yardımcı olabilecek var mı?

  • 10-11-2016, 05:35:31
    #2
    <!DOCTYPE html>
    <html lang="en">
    <head>
    	<meta charset="UTF-8" />
    	<title>CODEKSPER</title>
    </head>
    <body>
    	<input type="text" id="search_input"/>
    	<button type="button" id="search_button">search</button>
    	<script type="text/javascript">
    		document.getElementById("search_button").addEventListener("click", run_codeksper_test_function);
    		function run_codeksper_test_function(){
    			var search_data = document.getElementById("search_input").value;
    			if( search_data.length > 0 ){ window.location.href="http://www.domain.com/search/"+search_data; }
    			else{ alert("Ne arıyon hacı, bişeyler yaz hele"); }
    		}
    	</script>
    </body>
    </html>
  • 10-11-2016, 06:49:32
    #3
    codeksper adlı üyeden alıntı: mesajı görüntüle
    <!DOCTYPE html>
    <html lang="en">
    <head>
    	<meta charset="UTF-8" />
    	<title>CODEKSPER</title>
    </head>
    <body>
    	<input type="text" id="search_input"/>
    	<button type="button" id="search_button">search</button>
    	<script type="text/javascript">
    		document.getElementById("search_button").addEventListener("click", run_codeksper_test_function);
    		function run_codeksper_test_function(){
    			var search_data = document.getElementById("search_input").value;
    			if( search_data.length > 0 ){ window.location.href="http://www.domain.com/search/"+search_data; }
    			else{ alert("Ne arıyon hacı, bişeyler yaz hele"); }
    		}
    	</script>
    </body>
    </html>
    Teşekkürler hocam. işimi gördü