Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
So here is my site: http://dll-download.us/
I want it where if someone clicks on "Can't Find a File?", I want it to instead select the search box so they can search for it instead.
Code of search box on my site:
<form method="get" action="/search" id="search">
<input name="q" type="text" size="40" placeholder="Search for a DLL" />
</form>
The easiest way to do this would be to add a click event to the can't find a file link, then use JavaScript to focus the text box.
function setFocus() {
document.getElementById("myTextbox").focus();
}
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
Photo of the website
I have a school project and I need to make a website where I can add more balance to my account. But I can't figure it out.
I would like to make an HTML number input and then that input needs to add up with my existing balance. But I can't make it work
This is the code I have:
<fieldset>
<legend>Opwaarderen</legend>
<input type="number" id="opwaarderen">
<input type="submit" onclick="opwaarderen()">
</fieldset
But how can I make the Javascript function? So that the input will add up to my already existing balance.
This will help
var currentCredit=0;
$("#a").click(()=>
{
alert(currentCredit+=Number($("#opwaarderen").val()));
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<fieldset>
<legend>Opwaarderen</legend>
<input type="number" id="opwaarderen">
<input type="submit" id="a">
</fieldset>
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I tried
<input type="text" name="first_name"
onkeyup="value=value.replace(/[\-\'\.\,\/\`\:\~\!\#\#\$\%\^\&\*\(\)\_\+\=\;\|\{\}\[\]\<\>\?]/g,'')">
it works for almost all special chars, but when I add a double-quote filter like
<input type="text" name="first_name" in first
onkeyup="value=value.replace(/[\"\-\'\.\,\/\`\:\~\!\#\#\$\%\^\&\*\(\)\_\+\=\;\|\{\}\[\]\<\>\?]/g,'')">
it seems to not allow to do like that. I want to custom remove the mark I want.
You can put your code in an external function instead of placing it inline. It's just that the " interferes with the html attributes' " and break the code.
document.querySelector(".no-special-chars").addEventListener("keyup", function(){
this.value = this.value.replace(/[\"\-\'\.\,\/\`\:\~\!\#\#\$\%\^\&\*\(\)\_\+\=\;\|\{\}\[\]\<\>\?]/g,'');
});//keyup()
<input class="no-special-chars" type="text" name="first_name" />
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I want the text i type in
<input type="text" name="text1">
will automatically be updated in
<input type="text" name="text2">
by using JavaScript.
Anyone know how to solve it?
Thanks in advance
You can use the onkeyup event and populate the second <input> with the text of the first one, like this:
var inp1 = document.getElementsByName('text1')[0],
inp2 = document.getElementsByName('text2')[0];
inp1.addEventListener('keyup', function(e) {
inp2.value = this.value;
});
<p>Input 1: <input type="text" name="text1" placeholder="write something here..."></p>
<p>Input 2: <input type="text" name="text2" placeholder="ant it will show up here..."></p>
Test it using the "Run code snippet" button.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
When text field is empty and no cursor int the text field want to transparent and spell checker is not working. the showing the result <div> want to little left.
That code CSS or JavaScript or in PHP.
<form method="post" name="tasktitleform">
<input id="Search" class="search" type="text" name="Search" contenteditable="true" spellcheck="true" />
<input class="save" value="submit" type="submit" />
</form>
The footer code is not sticking under the window. That's way I copied from google and simply change the color to light yellow.
In this spellcheck not working CSS not working in the IE.
your question is not clear. Based on your question title, here is jquery snippet for changing opacity on focus and focusout events
$("#tbx").focus(function(){
$(this).css("opacity","1");
});
$("#tbx").focusout(function(){
if($(this).val()=="")
$(this).css("opacity","0.6");
});
jsfiddle sample http://jsfiddle.net/zxdwa0e8/3/
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I just want to pass more than 1 parameter to another page. How to do that?
<input type="submit" value="Add Student" name="submit"
onClick="javascript:window.location='editcode.jsp?prid=<%=rs.getString(1)%>&<%=name%>&<%=age%> &<%=sex%> &<%=phone%>';"
style="background-color:#49743D;font-weight:bold;color:#ffffff;">
You have only specified the parameter name for prid, all the others are only values.
Your output would look something like this:
<input type="submit" value="Add Student" name="submit"
onClick="javascript:window.location='editcode.jsp?
prid=some-value&some-value&some-value&some-value&some-value';
style="background-color:#49743D;font-weight:bold;
color:#ffffff;">
Which will present empty parameters with names that are the values you want to set them to -- not their proper names -- for the last 4 parameters.
I think you want to change your code to:
<input type="submit" value="Add Student" name="submit"
onClick="javascript:window.location='editcode.jsp?
prid=<%=rs.getString(1)%>
&name=<%=name%>
&age=<%=age%>
&sex=<%=sex%>
&phone=<%=phone%>';"
style="background-color:#49743D;font-weight:bold;color:#ffffff;">