If statement not working properly in form validation [closed] - javascript

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
I've would like to make a really simple form validation is JS.
I've created a function with if statements inside,while everything is ok it should display nothing and when something is not right (number in a name input for e.g)
a message under a certain input should be displayed.Right now it sometimes work,sometimes not.
If anybody could look at my code and tell me what's wrong would be really helpful
Here's my live version
Here's the code

You are using name="name-surname" twice (in two different input tags), which prevents the values to be sent properly. Use the same values for name as the values for the IDs

Related

Value change of input with no id [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 days ago.
Improve this question
enter image description here
enter image description here
I can't edit the html as I am using another system. I'm trying to change the value of an input field without an id with the value of a drop-down by clicking button. I'm really stumped on the no id part.
See images to see if you have any suggestions.
Thank you as I am new to Java.
I tried document.queryselector, but don't know how to use it.
I can only use basic Java.

JavaScript, what is "binde" means, not "bind"? document.binde.tagname...? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I have in my JS code, some lines with binde, what is it? Why is it working and what does it mean?
On example with, type="checkbox":
if (document.binde.nameofthecheckbox.checked)
{
//...its true whens checked and do the code
}
or
somevar = document.binde.somehtmltagname.value;
somevar gets the value of "somehtmltagname"
No one can answer me, I only heard "never seen something like that before". I would be happy to know what it is, and not only using it because it works.
It is not well known, but document might define HTML elements with id specified as document[HTMLElement.ID] as such, if there is an <input id="binde"> on the page, it will point to that.
If not, try logging it:
console.log(document.binde)

Trying to get a simple php form to fire [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
I shouldnt even be in HTML/CSS, but here I am trying to incorporate a php modal contact form into my site...
I'm trying to get all of a demo form's functionality into my footer page (and then I'll restyle everything.)
http://danux.me/sections/footer_modal.html
I'm trying to get "email me" to fire ideally, but am settling now for just the Demo button to fire the popup form.
I also uploaded the demo form I'm pulling code from, just to make sure it works on my site. (It does.)
http://danux.me/contact/
Any guesses as to what I'm doing wrong?
Your first link is in a different folder, yet the url for $.get points to the same relative file. Which isn't there.
So in contact.js needs to have
$.get("../contact/data/contact.php", function(data){
I obviously cant test this. And it looks like there is some redesign in folderstructure coming up.

How can I literally just print HTML to a site using PHP without it being rendered? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I'm trying to generate HTML using PHP and have that HTML printed out and displayed on a site for a user to then copy and paste elsewhere. My problem, however, is that whenever I try to use print or echo statements and type in the HTML, the HTML is being rendered instead of simply just printed. I even put the HTML as a string into a variable and tried printing/echoing that variable but it was also rendered. Is there any way to literally just have the words I'm typing (which happen to be HTML) printed or displayed in some way on the page in a box or something of the sort?
if I understood your question, I think you should use htmlentities():
print htmlentities('<br>');
This wil show the tag instead of generate a new line.

data attribute from anchor not sending value ti hidden input [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I have this anchor tag
<a class="productin" onclick="openbox()" data-pid="23">Report</a>
This opens up an modal box which sends an email, I have a hidden input tag inside that email form in which i want to add that data-pid
<input type="hidden" name="productid" id="productid">
Since you tagged this question with jQuery, I'll give you the jQuery answer. This should work:
$(function(){
$('a.productin').click(function(){
$('input:hidden[name="productid"]').val($(this).data('pid'));
});
});
FYI - It is normal procedure in Stack Overflow to post the code you have tried on your own. We are here to help you fix issues with your code, not to write your code for you. In the future do a search for an answer before you ask the question and give it a shot on your own. Then, you can ask why your code didn't work posting the relevant code for us to see. That's is why your question was voted down.
It is also normal procedure for the downvoter to explain why he voted it down.

Categories