Id searching on the same page
When I click the category for the License, nothing happens.
<script>
function goToPage( select1 ) {
var node = document.getElementById( select1 );
if( node &&
node.tagName == "SELECT" ) {
// Go to web page defined by the VALUE attribute of the OPTION element
window.location.href = node.options[node.selectedIndex].value;
} // endif
}
</script>
<center><label for="select1">Go to Marker</label></center>
<select id="select1" onChange="goToPage('select1')">
<?php
$conn=mysql_connect("localhost","root","");
mysql_select_db("dbposo",$conn);
$news=mysql_query("select id,license from tblviolator");
while($data=mysql_fetch_array($news))
{
$id=$data['id'];
$license=$data['license'];
print "
<option value='#X$id'>$license</option>
";
}
?>
</select>
javascript php
|
show 5 more comments
When I click the category for the License, nothing happens.
<script>
function goToPage( select1 ) {
var node = document.getElementById( select1 );
if( node &&
node.tagName == "SELECT" ) {
// Go to web page defined by the VALUE attribute of the OPTION element
window.location.href = node.options[node.selectedIndex].value;
} // endif
}
</script>
<center><label for="select1">Go to Marker</label></center>
<select id="select1" onChange="goToPage('select1')">
<?php
$conn=mysql_connect("localhost","root","");
mysql_select_db("dbposo",$conn);
$news=mysql_query("select id,license from tblviolator");
while($data=mysql_fetch_array($news))
{
$id=$data['id'];
$license=$data['license'];
print "
<option value='#X$id'>$license</option>
";
}
?>
</select>
javascript php
Your URL should end up looking like example.com/mypage.php#X123 - is this the case?
– Niet the Dark Absol
Feb 24 '14 at 10:58
getelementbyid('select1') try giving quotes
– Dimag Kharab
Feb 24 '14 at 11:00
Yes sir, what should i do? :(
– user3346154
Feb 24 '14 at 11:00
@CodingAnt nothing happened :(
– user3346154
Feb 24 '14 at 11:01
Have you got any error on firebug console?
– Hüseyin BABAL
Feb 24 '14 at 11:04
|
show 5 more comments
When I click the category for the License, nothing happens.
<script>
function goToPage( select1 ) {
var node = document.getElementById( select1 );
if( node &&
node.tagName == "SELECT" ) {
// Go to web page defined by the VALUE attribute of the OPTION element
window.location.href = node.options[node.selectedIndex].value;
} // endif
}
</script>
<center><label for="select1">Go to Marker</label></center>
<select id="select1" onChange="goToPage('select1')">
<?php
$conn=mysql_connect("localhost","root","");
mysql_select_db("dbposo",$conn);
$news=mysql_query("select id,license from tblviolator");
while($data=mysql_fetch_array($news))
{
$id=$data['id'];
$license=$data['license'];
print "
<option value='#X$id'>$license</option>
";
}
?>
</select>
javascript php
When I click the category for the License, nothing happens.
<script>
function goToPage( select1 ) {
var node = document.getElementById( select1 );
if( node &&
node.tagName == "SELECT" ) {
// Go to web page defined by the VALUE attribute of the OPTION element
window.location.href = node.options[node.selectedIndex].value;
} // endif
}
</script>
<center><label for="select1">Go to Marker</label></center>
<select id="select1" onChange="goToPage('select1')">
<?php
$conn=mysql_connect("localhost","root","");
mysql_select_db("dbposo",$conn);
$news=mysql_query("select id,license from tblviolator");
while($data=mysql_fetch_array($news))
{
$id=$data['id'];
$license=$data['license'];
print "
<option value='#X$id'>$license</option>
";
}
?>
</select>
javascript php
javascript php
edited Nov 22 '18 at 17:41
Cœur
18.7k9110150
18.7k9110150
asked Feb 24 '14 at 10:54
user3346154user3346154
94
94
Your URL should end up looking like example.com/mypage.php#X123 - is this the case?
– Niet the Dark Absol
Feb 24 '14 at 10:58
getelementbyid('select1') try giving quotes
– Dimag Kharab
Feb 24 '14 at 11:00
Yes sir, what should i do? :(
– user3346154
Feb 24 '14 at 11:00
@CodingAnt nothing happened :(
– user3346154
Feb 24 '14 at 11:01
Have you got any error on firebug console?
– Hüseyin BABAL
Feb 24 '14 at 11:04
|
show 5 more comments
Your URL should end up looking like example.com/mypage.php#X123 - is this the case?
– Niet the Dark Absol
Feb 24 '14 at 10:58
getelementbyid('select1') try giving quotes
– Dimag Kharab
Feb 24 '14 at 11:00
Yes sir, what should i do? :(
– user3346154
Feb 24 '14 at 11:00
@CodingAnt nothing happened :(
– user3346154
Feb 24 '14 at 11:01
Have you got any error on firebug console?
– Hüseyin BABAL
Feb 24 '14 at 11:04
Your URL should end up looking like example.com/mypage.php#X123 - is this the case?
– Niet the Dark Absol
Feb 24 '14 at 10:58
Your URL should end up looking like example.com/mypage.php#X123 - is this the case?
– Niet the Dark Absol
Feb 24 '14 at 10:58
getelementbyid('select1') try giving quotes
– Dimag Kharab
Feb 24 '14 at 11:00
getelementbyid('select1') try giving quotes
– Dimag Kharab
Feb 24 '14 at 11:00
Yes sir, what should i do? :(
– user3346154
Feb 24 '14 at 11:00
Yes sir, what should i do? :(
– user3346154
Feb 24 '14 at 11:00
@CodingAnt nothing happened :(
– user3346154
Feb 24 '14 at 11:01
@CodingAnt nothing happened :(
– user3346154
Feb 24 '14 at 11:01
Have you got any error on firebug console?
– Hüseyin BABAL
Feb 24 '14 at 11:04
Have you got any error on firebug console?
– Hüseyin BABAL
Feb 24 '14 at 11:04
|
show 5 more comments
1 Answer
1
active
oldest
votes
you can simply write your select tag as follows without calling the function. if you only want to redirect on the value of your select box
<select id="select1" onChange="window.location.href=this.value;">
UPDATE 2:
<script>
var current_url = window.location.href ;
function goToPage(val) {
window.location.href = current_url+val;
}
</script>
<select id="select1" onChange="goToPage(this.value);">
nothings happening sir
– user3346154
Feb 24 '14 at 11:03
try my update 2
– Satish Sharma
Feb 24 '14 at 11:14
thank you sir :) but i can't still vote :) i'll vote for you if i have 15 reputation :)
– user3346154
Feb 24 '14 at 11:25
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f21985687%2fid-searching-on-the-same-page%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
you can simply write your select tag as follows without calling the function. if you only want to redirect on the value of your select box
<select id="select1" onChange="window.location.href=this.value;">
UPDATE 2:
<script>
var current_url = window.location.href ;
function goToPage(val) {
window.location.href = current_url+val;
}
</script>
<select id="select1" onChange="goToPage(this.value);">
nothings happening sir
– user3346154
Feb 24 '14 at 11:03
try my update 2
– Satish Sharma
Feb 24 '14 at 11:14
thank you sir :) but i can't still vote :) i'll vote for you if i have 15 reputation :)
– user3346154
Feb 24 '14 at 11:25
add a comment |
you can simply write your select tag as follows without calling the function. if you only want to redirect on the value of your select box
<select id="select1" onChange="window.location.href=this.value;">
UPDATE 2:
<script>
var current_url = window.location.href ;
function goToPage(val) {
window.location.href = current_url+val;
}
</script>
<select id="select1" onChange="goToPage(this.value);">
nothings happening sir
– user3346154
Feb 24 '14 at 11:03
try my update 2
– Satish Sharma
Feb 24 '14 at 11:14
thank you sir :) but i can't still vote :) i'll vote for you if i have 15 reputation :)
– user3346154
Feb 24 '14 at 11:25
add a comment |
you can simply write your select tag as follows without calling the function. if you only want to redirect on the value of your select box
<select id="select1" onChange="window.location.href=this.value;">
UPDATE 2:
<script>
var current_url = window.location.href ;
function goToPage(val) {
window.location.href = current_url+val;
}
</script>
<select id="select1" onChange="goToPage(this.value);">
you can simply write your select tag as follows without calling the function. if you only want to redirect on the value of your select box
<select id="select1" onChange="window.location.href=this.value;">
UPDATE 2:
<script>
var current_url = window.location.href ;
function goToPage(val) {
window.location.href = current_url+val;
}
</script>
<select id="select1" onChange="goToPage(this.value);">
edited Feb 25 '14 at 5:14
answered Feb 24 '14 at 11:01
Satish SharmaSatish Sharma
8,42962244
8,42962244
nothings happening sir
– user3346154
Feb 24 '14 at 11:03
try my update 2
– Satish Sharma
Feb 24 '14 at 11:14
thank you sir :) but i can't still vote :) i'll vote for you if i have 15 reputation :)
– user3346154
Feb 24 '14 at 11:25
add a comment |
nothings happening sir
– user3346154
Feb 24 '14 at 11:03
try my update 2
– Satish Sharma
Feb 24 '14 at 11:14
thank you sir :) but i can't still vote :) i'll vote for you if i have 15 reputation :)
– user3346154
Feb 24 '14 at 11:25
nothings happening sir
– user3346154
Feb 24 '14 at 11:03
nothings happening sir
– user3346154
Feb 24 '14 at 11:03
try my update 2
– Satish Sharma
Feb 24 '14 at 11:14
try my update 2
– Satish Sharma
Feb 24 '14 at 11:14
thank you sir :) but i can't still vote :) i'll vote for you if i have 15 reputation :)
– user3346154
Feb 24 '14 at 11:25
thank you sir :) but i can't still vote :) i'll vote for you if i have 15 reputation :)
– user3346154
Feb 24 '14 at 11:25
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f21985687%2fid-searching-on-the-same-page%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Your URL should end up looking like example.com/mypage.php#X123 - is this the case?
– Niet the Dark Absol
Feb 24 '14 at 10:58
getelementbyid('select1') try giving quotes
– Dimag Kharab
Feb 24 '14 at 11:00
Yes sir, what should i do? :(
– user3346154
Feb 24 '14 at 11:00
@CodingAnt nothing happened :(
– user3346154
Feb 24 '14 at 11:01
Have you got any error on firebug console?
– Hüseyin BABAL
Feb 24 '14 at 11:04