/    Sign up×
Community /Pin to ProfileBookmark

Search Field choice re-directs to a certain page …

The video web script, that I’m using, has a search-field where if you enter a letter, for example ‘c’, several choices on a list drops-down to select from. If you choose one of those ‘titles’ you’re redirected to the ‘watch’ page, but if you don’t choose one, and just hit ‘return’, you are redirected to the ‘search results’ page, where you can select which ‘title’ to choose. I’d like assistance with getting every search-field search to redirect to the ‘search results’ page, not the ‘watch’ page. I’m not sure if this is a php or html issue. Here are some lines of code that may be related to this issue:

[CODE]
if ($pt->config->total_videos > 1000000) {
$get_videos = $db->where(“MATCH (title) AGAINST (‘$keyword’) AND privacy = 0 “.$category.$date)->orderBy(‘id’, ‘ASC’)->objectbuilder()->paginate(T_VIDEOS, $pt->page_number);
$pt->total_pages = $db->totalPages;
} else {
$get_videos = $db->where(“title LIKE ‘%$keyword%’ AND privacy = 0 “.$category.$date)->orderBy(‘id’, ‘ASC’)->objectbuilder()->paginate(T_VIDEOS, $pt->page_number);
$pt->total_pages = $db->totalPages;
[/CODE]

and here’s some related javascript:

[CODE]
<script>

$(‘.search-icon’).on(‘click’, function(event) {
event.preventDefault();
$(‘.search-bar’).toggleClass(‘hidden’);
});
$(‘#search-bar’).keyup(function(event) {
var search_value = $(this).val();
var search_dropdown = $(‘.search-dropdown’);
if (search_value == ”) {
search_dropdown.addClass(‘hidden’);
search_dropdown.empty();
return false;
} else {
search_dropdown.removeClass(‘hidden’);
}
$.post(‘{{LINK aj/search}}’, {search_value: search_value}, function(data, textStatus, xhr) {
if (data.status == 200) {
search_dropdown.html(data.html);
} else {
search_dropdown.addClass(‘hidden’);
search_dropdown.empty();
return false;
}
});
});
</script>
[/CODE]

any assistance is appreciated

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @chrisjchrisj spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...