1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Javascript help please..im a noob! :-)

Discussion in 'Programming' started by Solstice2747, Oct 26, 2019.

  1. #1
    I will try and keep this short....I have played around MANY years ago with html and coping and pasting JavaScript and making webpages. But have not kept up with it and need some help. I need a code that can make several text boxes on a web page.
    -------------------------------------------------------
    Name
    First
    Last
    Badge #

    Best way to be contacted
    Email
    Text
    Call
    -----------------------------------------------------------

    after the person fills out name and badge number they can only choose one category (it doesn't matter if its drop down menu or like the photo attached). Then depending which of the 3 (email, text, call) they choose it will compile a list of those 3 separate categories. But I would need the info private so only I can read it. Im not sure how this is done.....if its generates a list on three different private web pages,or stored in a file on server ,or how can I view this info privately. Is this hard to make? Can someone help me or point me in the right direction? I appreciate any and all help.
    Thank You,Randy 20191026_120211.jpg
     
    Solstice2747, Oct 26, 2019 IP
  2. RahulSaini

    RahulSaini Well-Known Member

    Messages:
    222
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    123
    #2
    It can be done via JavaScript. To speed up development. You can use jQuery. it can help in shortening JS syntax.
    $('#badge').on('keyup',function(){
    //do something
    })
     
    RahulSaini, Oct 26, 2019 IP
  3. JEET

    JEET Notable Member

    Messages:
    3,825
    Likes Received:
    502
    Best Answers:
    19
    Trophy Points:
    265
    #3
    I am not able to understand your requirement properly, but from what I understood, you need people to fill a form, and then only you can read what they filled, right?

    You will need a scriptting language like PHP to submit and process the form. Javascript is not enough for this.

    With PHP, you can log the form data in a file, or in database, or email it directly to yourself, many ways...
     
    JEET, Oct 26, 2019 IP
  4. Solstice2747

    Solstice2747 Peon

    Messages:
    5
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    1
    #4

    I am sorry but I dont understand your reply. Is there somewhere that these scripts are already made and I can just copy ,cut ,and paste! or a software that will make the code for me?
     
    Solstice2747, Oct 28, 2019 IP
  5. Solstice2747

    Solstice2747 Peon

    Messages:
    5
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    1
    #5

    Hi,
    I am sorry that I confused you.But yes I want people to fill out a form and only I can see the info. I have never heard of PHP lol. But I will do some research on it. Is there a software that would generate this code for me? or websites that has them to copy, cut, and paste?

    Thank you for pointing me in the right direction.
     
    Solstice2747, Oct 28, 2019 IP
  6. Solstice2747

    Solstice2747 Peon

    Messages:
    5
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    1
    #6
    its been many years since I played around with HTML but this is what I would like. and if people choose to be contacted by email everbodys info would be on a list for email for only me to see. also the same for calls or text would be saved on a different area .

    html>
    <head>
    <title></title>
    </head>
    <body>
    <html><head><style>
    body, p{padding:0;margin:0;}
    </style>
    </head><body><br><br><br><br><br><CENTER><form action="mail.php" method="POST">
    <p>Name</p> <input type="text" name="name">
    <p>Email</p> <input type="text" name="email">
    <p>Phone</p> <input type="text" name="phone">
    <p>How would you like to be contacted:</p>
    Text:<input type="checkbox" value="Yes" name="call"><br>
    Email:<input type="checkbox" value="No" name="call"><br>
    Call:<input type="checkbox" value="No" name="call"><br>
    <input type="submit" value="Send">
    </form></CENTER>
    </body></html>
    </body>
    </html
     
    Solstice2747, Oct 28, 2019 IP
  7. JEET

    JEET Notable Member

    Messages:
    3,825
    Likes Received:
    502
    Best Answers:
    19
    Trophy Points:
    265
    #7
    I made the contact form for you in PHP, but its not secure in any way.
    Logging emails like this in a openly readable text file is not at all safe.

    Download the attached file "mail.txt"
    and rename it to: "mail.php"

    Now create an empty file "mailContact.txt"
    in the same folder where mail.php file is,
    and set writeable permissions for this "mailContact.txt" file (777)

    Then open yourdomain/mail.php in browser, and fill the form.
    Whatever you will fill, it will get stored in this "mailContact.txt" file

    if You wish to use this script, then save "mailContact.txt" file before your public_html folder.
    Suppose mail.php file is in:
    /home/yourdomain/public_html/mail.php

    then save "mailContact.txt" file in:
    /home/yourdomain/mailContact.txt


    and then change this line in mail.php file:
    $fp= fopen( "mailContact.txt", "a" );

    change to:
    $fp= fopen( "/home/yourdomain/mailContact.txt", "a" );

    P.S, I did not coded the method to notify you when someone submits the form.
    if you want it, simply add this line in the mail.php file

    mail( "", "New form submitted", "New form has been submitted on your website" );

    Add this line just above:
    $fp= fopen( "mailContact.txt", "a" );

    Change "" to a real email id of yours.

    Enjoy! :)
     

    Attached Files:

    JEET, Oct 28, 2019 IP
  8. Solstice2747

    Solstice2747 Peon

    Messages:
    5
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    1
    #8

    Hi Jeet,

    You are no doubt awesome! There is so many kind people in this world and you are one of them! Thank you very much I really do appreciate it ☺️

    No need to worry to. Much about security. I wanted this to place on a laptop and place in a room for about 1,500 people to sign in for 2 days. Once we have the info we will be done with it for another 4 years. Thank you so much I really appreciate you.. Have a wonderful day!
     
    Solstice2747, Oct 30, 2019 IP
    JEET likes this.
  9. JEET

    JEET Notable Member

    Messages:
    3,825
    Likes Received:
    502
    Best Answers:
    19
    Trophy Points:
    265
    #9
    Ah! Please don't mention it. It was 5 minute work. :) Gladd to help :)
     
    JEET, Oct 30, 2019 IP
  10. JEET

    JEET Notable Member

    Messages:
    3,825
    Likes Received:
    502
    Best Answers:
    19
    Trophy Points:
    265
    #10
    by the way, if you want this to work on a windows laptop, then you will need to install PHP first. Simply google search for "wamp", download it and install it somewhere in your laptop.

    Once install is done, copy the mail.txt file in <download location>\wampServer\www\mail.php

    and it will work.
    Thanks :)
     
    JEET, Oct 30, 2019 IP