Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Grabbing and comparing form values [Javascript / HTML]

How would I make it so if the visitor submits the name gerald it will write "wow" to the page
quite confused at the moment, if anyone could assist me using newbie terms that'll be great!
Here's what I got so far pastebin.com/mcN3FF3G what am I doing wrong ;c
First, it should be ===, not just =, and when do you expect this JavaScript to run? Does it have to be a form submit? Are you actually meaning to go back to the server? If so you need to add a click event on the button and cancel form submission, then renewable it if their name isn't Gerald. If you don't actually need form submission, delete the form and remove the submit values and just have your click event.
i do not understand a single word of that. i just want it to do something if the textbox has a certain name inside after clicking submit, thanks anyway.
PHP Code

<?php 
$("#submit").click(function(){
      if(($(
"#name").val() == "Gerald")) {
            
document.write("Wow");
        }
    }); 
https://hackforums.net/showthread.php?tid=6333106

Cheap Telegram RAT written in Rust
A single equal sign is only for setting values. Above, he's explaining you need to use two equal signs to compare value and three to compare exact values including capitals. True==true is true but true===1 would not be true. Tue==1 will output true. So in your case use (param == 'Gerald'). Js version of above:
Code
function isGerald(param)
{
    if(param == 'Gerald)
    {
        return 'Wow';
    }
    else
   {
        return false;
    }
}

document.body.innerHtml += '<p>' + isGerald (document.body.getElementById('input_element').value) + '</p>';


Possibly Related Threads...
Thread / Author Replies Views Last Post
by bigfatjoeApr 3, 2024 02:33 AM 5 190 Apr 3, 2024 02:33 AM
Last Post: siliconvalley
by blackcoder00Jul 23, 2020 06:24 AM 5 139 Jul 23, 2020 06:24 AM
Last Post: blackcoder00
by ANONDARKSTARJul 18, 2019 10:07 PM 2 154 Jul 18, 2019 10:07 PM
Last Post: ANONDARKSTAR