Id searching on the same page












0















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>









share|improve this question

























  • 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
















0















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>









share|improve this question

























  • 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














0












0








0








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>









share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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



















  • 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












1 Answer
1






active

oldest

votes


















0














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);">





share|improve this answer


























  • 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











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
});


}
});














draft saved

draft discarded


















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









0














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);">





share|improve this answer


























  • 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
















0














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);">





share|improve this answer


























  • 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














0












0








0







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);">





share|improve this answer















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);">






share|improve this answer














share|improve this answer



share|improve this answer








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



















  • 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




















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

If I really need a card on my start hand, how many mulligans make sense? [duplicate]

Alcedinidae

Can an atomic nucleus contain both particles and antiparticles? [duplicate]