Hack Forums
[Javascript] JAVASCRIPT FORM VALIDATION BEFORE SUBMITING HELP i'ld pay - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Web Development (https://hackforums.net/forumdisplay.php?fid=183)
+---- Thread: [Javascript] JAVASCRIPT FORM VALIDATION BEFORE SUBMITING HELP i'ld pay (/showthread.php?tid=6189334)



JAVASCRIPT FORM VALIDATION BEFORE SUBMITING HELP i'ld pay - Professional Hacker - Jan 16, 2022

Hello,

1.)

i have a html script already i want it to do this exact function before submiting, check this image i uploaded below, i want it to do the same thing,

[Image: 1_388.png]

[Image: 2_279.png]

unless a value is typed in before it goes to the next error page and after that it redirect to what ever site which mean it delivers two forms to php before moving to it redirected site out of the html, i have the html script already help me fix



2.) i'm willing to pay for this all i needed for this if a country is selected like united states or united kingdom it brings out a paticular input field, to be filled before submitting and show error on all if anyone is empty, so i'ld tell you the paticular input filed i'll like to include kindly dm


[Image: 3_194.png]

[Image: 4_141.png]


dm me for both thank you.


RE: JAVASCRIPT FORM VALIDATION BEFORE SUBMITING HELP i'ld pay - Romeos - Jan 18, 2022

I can help you with that, dm me in a convo.


RE: JAVASCRIPT FORM VALIDATION BEFORE SUBMITING HELP i'ld pay - Hackers - Jan 20, 2022

you could do something like this probably
Code
var country = document.getElementById("country-input"),
     other = country = document.getElementById("new-input"); // a hidden input
country.addEventListener("change", (e) => {
const newval = e.target.value;
if(newval == "United States"){
  other.style.display = "block";
}
});
This listens for a change in the input value of the country field, and then shows another field (or div, or anything) if the value matches the US. You may need to change some things, but this should work.

You should change your logos and colors though so people don't confuse you with another company. Js.js