Въпрос за Ajax и PHP

C++ JAVA
Post Reply
Knoppix_
Турист
Турист
Posts: 322
Joined: Mon Aug 24, 2009 11:55 am

Въпрос за Ajax и PHP

Post by Knoppix_ » Mon Jun 24, 2013 2:41 pm

Здравейте,

един много глупав въпрос но от одеве гледам и немога да се ориентирам

имам два инпута единият е този

Code: Select all

        <div class="fitem"><label>Ремарке&#58;</label><input name="trailer_number" class="easyui-validatebox" required="true" onkeyup="lookup_remarke&#40;this.value&#41;;" onblur="fill_remarke&#40;&#41;;">
        <div class="suggestionsBox" id="suggestions_remarke" style="display&#58; none;">
				<img src="images/upArrow.png" style="position&#58; relative; top&#58; -12px; left&#58; 30px;" alt="" />
				<div class="suggestionList" id="autoSuggestionsList_remarke">
					&nbsp;
				</div>
			</div>
Този е другият

Code: Select all

 <div class="fitem"> <label>Влекач&#58;</label><input id="vlekach_number" name="vlekach_number" class="easyui-validatebox" required="true" onkeyup="lookup&#40;this.value&#41;;" onblur="fill&#40;&#41;;" >
<div class="suggestionsBox" id="suggestions" style="display&#58; none;">
				<img src="images/upArrow.png" style="position&#58; relative; top&#58; -12px; left&#58; 30px;" alt="" />
				<div class="suggestionList" id="autoSuggestionsList">
					&nbsp;
				</div>
			</div>
        </div>
А това ми е скрипта

Code: Select all

	function lookup&#40;inputString&#41; &#123;
		if&#40;inputString.length == 0&#41; &#123;
			// Hide the suggestion box.
			$&#40;'#suggestions'&#41;.hide&#40;&#41;;
		&#125; else &#123;
			$.post&#40;"pages/vlekachi_db.php", &#123;queryString&#58; ""+inputString+""&#125;, function&#40;data&#41;&#123;
				if&#40;data.length >0&#41; &#123;
					$&#40;'#suggestions'&#41;.show&#40;&#41;;
					$&#40;'#autoSuggestionsList'&#41;.html&#40;data&#41;;
				&#125;
			&#125;&#41;;
		&#125;
	&#125; // lookup
	
	function fill&#40;thisValue&#41; &#123;
		$&#40;'#vlekach_number'&#41;.val&#40;thisValue&#41;;
		setTimeout&#40;"$&#40;'#suggestions'&#41;.hide&#40;&#41;;", 200&#41;;
	&#125;
	
	/////////////////////////////////////Remarke
	function lookup_remarke&#40;inputString&#41; &#123;
		if&#40;inputString.length == 0&#41; &#123;
			// Hide the suggestion box.
			$&#40;'#suggestions_remarke'&#41;.hide&#40;&#41;;
		&#125; else &#123;
			$.post&#40;"pages/remarketa_db.php", &#123;queryString&#58; ""+inputString+""&#125;, function&#40;data&#41;&#123;
				if&#40;data.length >0&#41; &#123;
					$&#40;'#suggestions_remarke'&#41;.show&#40;&#41;;
					$&#40;'#autoSuggestionsList_remarke'&#41;.html&#40;data&#41;;
				&#125;
			&#125;&#41;;
		&#125;
	&#125; // lookup
	
	function fill_remarke&#40;thisValue&#41; &#123;
		$&#40;'#trailer_number'&#41;.val&#40;thisValue&#41;;
		setTimeout&#40;"$&#40;'#suggestions_remarke'&#41;.hide&#40;&#41;;", 200&#41;;
	&#125;
Проблема ми е че когато от autocomplete на ремарке като избера стойност тя се визуализира в полето vlekach_number някой може ли да ми удари едно рамо моля ви

Post Reply