farbods0
-
Posts
16 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by farbods0
-
-
Well i guess you did it wrong then, shame.
Lol well that was a different response than expected
-
It wouldn't would it '// code to hide custom dropdown' is just a comment for you to add the code related to hiding custom dropdown it doesn't do anything else, if you add in its place
alert('keypressed');
you should get a annoying alert showing 'keypressed' everytime you press a character key in the inputs box
Hmm I tried that but it just deletes anything you type into the inputbox. What I was looking for was to clear the dropdown selection if a user starts typing into the input box.
-
Use id ref like before
$(document).ready(function(){ $("#dropdownID").keypress(function(){ // code to hide custom dropdown }); });
I tought i was getting the hang of this, but its not working
-
You would use '.keypress' which will detect then trigger code to hide dropdown, but the jquery select2 library uses a mixture of created span and ul,li elements to produce the customized dropdown, so you would have to hide() or fadeOut() those elements parent element instead.
$(document).ready(function(){$("input").keypress(function(){Along these lines? -
Validate or look at the id value carefully, it has to match exactly what jquery refers to without the hash at beginning, and you need to close the input tag, which is the main reason the id value is wrong, also using js fiddle you have place specific code in its respective section.
Wow can't believe that was the reason. Thank you so much it works now!! Now need to figure how to remove the dropdown selection if the user types into the input box
-
The link element as it is, should be placed in between <head> and </head> area, but since it passed, but! I want you to move it.
<script type="text/javascript"> $(document).ready(function() { var dropDown = [" ","Run1", "Run2", "Testplan", "Rails", "Europa"]; var dropDownID = [" ","111111", "222222", "333333", "444444", "555555"]; $("#dropDown").select2({ data: dropDown }); //added code by dsonesuk $("#dropDown").change(function() { $("#dropdownID").val(dropDownID[$("#dropDown option:selected").index()]); }); }); </script>
This from above highlighted in red
$("#dropdownID").val(dropDownID[$("#dropDown option:selected").index()]);
is a reference to a ID attribute value where '#' specifies that it is a id name, whereas '.' a period or full stop character used here '.something' refers to a class name.
This means you need to add a id ref of 'dropdownID' on that element you wish to target to add the specific relative value from array, like so
Testrail Plan ID:<input type="text" id="dropdownID"><br><br>
Hmm strange I did it like you asked, (even changed the link) but still nothing gets populated in the Plan ID: box
-
Validation states at https://validator.w3.org/ 5 errors remain, it gives description of what they are, I suggest you go through tutorials on html to know the proper layout of the html document, until then, no solution.
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> Test Modify </title> </head> <body> <p>Load Previous Run or Load Test Plan ID.</p> <script src="https://code.jquery.com/jquery-2.1.1.min.js" type="text/javascript"></script> <link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.1/css/select2.min.css" rel="stylesheet" /> <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.1/js/select2.min.js"></script> <!--Drop down menu with search function--> <script type="text/javascript"> $(document).ready(function() { var dropDown = [" ","Run1", "Run2", "Testplan", "Rails", "Europa"]; var dropDownID = [" ","111111", "222222", "333333", "444444", "555555"]; $("#dropDown").select2({ data: dropDown }); }); </script> <div> <select id="dropDown" style="width:300px;"> <!-- Dropdown List Option --> </select> </div> <!--TRPID Input box--> <br><br> Testrail Plan ID:<input type="text"><br><br> <!--Makes the window size smaller--> <script type="text/javascript"> window.resizeTo(500,300); </script> <!--Function for ready to call test plan--> <script type="text/javascript"> var sUserName=""; function fnCallDialog() { showModelessDialog("testLaunch.hta",window,"status:false;dialogWidth:300px;dialogHeight:300px"); } </script> <input type= "button" onclick="location.href='http://linux28.aquantia.com/testrail/index.php?/plans/view/testPlanID';" value="Open Testrail Test Plan for Modiciation"/><br><br> <input type= "button" value="Ready to Launch Test Plan" onClick="fnCallDialog()"> </body> </html>
Sorry about that, its just my first time doing html, but I fixed all the errors now but I still can't figure out where to play that snippet of code you sent
-
<!DOCTYPE html>
<p>Load Previous Run or Load Test Plan ID.</p>
<script src="https://code.jquery.com/jquery-2.1.1.min.js" type="text/javascript"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.1/css/select2.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.1/js/select2.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var dropDown = [" ","color", "shape", "tool"];
var dropDownID = [" ","orange", "square", "hammer"];
$("#dropDown").select2({
data: dropDown
});
$("#dropDown").change(function() {
$("#dropdownID").val(dropDownID[$("#dropDown option:selected").index()]);
});
});
</script>
</head>
<body>
<div>
<select id="dropDown" style="width:300px;">
<!-- Dropdown List Option -->
</select>
</div>
</body>
<!--TRPID Input box-->
<br><br> Testrail Plan ID:<input type="text" TTPID="PlanID"><br><br>
-
I now know the problem, but! I told you to validate and correct your code, and you gave the impression that you had and still had the problem, when in fact you had not done anything of the kind, so until you correct the code, i'm not going to give you the solution, you might get someone to inform you, but not me! Until you fix the code.
I don't know what you mean by validating, I went through the validator link you sent, typed in the code and it says 3 invalid but I run the code and it still runs fine
-
Show us what you have done, then! Just saying it still doesn't work does nothing to help find a solution.
<p>Load Previous Run or Load Test Plan ID.</p> <script src="https://code.jquery.com/jquery-2.1.1.min.js" type="text/javascript"></script> <link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.1/css/select2.min.css" rel="stylesheet" /> <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.1/js/select2.min.js"></script> <script type="text/javascript"> $(document).ready(function() { var dropDown = [" ","color", "shape", "tool"]; var dropDownID = [" ","orange", "square", "hammer"]; $("#dropDown").select2({ data: dropDown }); $("#dropDown").change(function() { $("#dropdownID").val(dropDownID[$("#dropDown option:selected").index()]); }); }); </script> </head> <body> <div> <select id="dropDown" style="width:300px;"> <!-- Dropdown List Option --> </select> </div> </body> <!TRPID Input box-> <br><br> Testrail Plan ID:<input type="text" TTPID="PlanID"><br><br>
-
Probably because your html coding is all over the place, try validating at https://validator.w3.org/ I added this code using one of w3schools jquery 'Try it' page and it worked fine after I fixed everything.
Tried it still didn't work. Its still not populating the input field
-
All you have to do is make sure the index position of selection matches that of related index position in array 'dropDownID'
$("#dropDown").change(function() { $("#dropdownID").val(dropDownID[$("#dropDown option:selected").index()]); });
Sorry I placed that snippet into my code but nothing seems to have changed
-
Hi is there a way to have a drop down menu insert its dictionary value into a textbox? For example lets say dropdown shows , shape, tool. When you click the color option then "orange" would populate the textbox, if you select shape then "square" would populate, so on and so forth.
Also when you type something into the textbox the dropdown selected item disappears.
<!Drop down menu with search function->
<p>Load Previous Run or Load Test Plan ID.</p>
<script src="https://code.jquery.com/jquery-2.1.1.min.js" type="text/javascript"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.1/css/select2.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.1/js/select2.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var dropDown = [" ","color", "shape", "tool"];
var dropDownID = [" ","orange", "square", "hammer"];
$("#dropDown").select2({
data: dropDown
});
});
</script>
</head>
<body>
<div>
<select id="dropDown" style="width:300px;">
<!-- Dropdown List Option -->
</select>
</div>
</body>
<!TRPID Input box->
<br><br> Testrail Plan ID:<input type="text" TTPID="PlanID"><br><br>
-
Where would i put that exactly? Like can i give you my whole code. Also I thought it would involve something like this {block:TagPage}
{/block:TagPage} -
Hey u guys first time here and would greatly appreciate it if someone can help me do this been trying for the past 3 days. I want to make my main page hide everything of a certain tag but still show up on a page. So like hide all the submissions from my main page but still remain under my submission link page. thanks visualexstasy.tumblr.com
Html dropdown menu insert into text box?
in HTML/XHTML
Posted · Edited by farbods0
Sorry this is what it's like