Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7184381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:11:25+00:00 2026-05-28T18:11:25+00:00

<form name=email method=post action=forms/email.php> <div id=email> Sign up for Email <input type=hidden value=<?php $page;

  • 0
<form name="email" method="post" action="forms/email.php">
    <div id="email">
Sign up for Email
<input type="hidden" value="<?php $page; ?>" name="page">
<input class="searchtext" name="name" type="text" value="Name" id="nameId"/>
<input class="searchtext" name="email" type="text" value="Email" id="emailId"/>
    <a id="submit" class="submitbutton" onClick="document.getElementById('search-form').submit()"></a>
    </div>
 </form>
<script type="text/javascript">
    var name = document.getElementById("nameId");
    name.addEventListener("click",func,false);
    function func() {
        alert(name.value)
    }
</script>

I am trying to listen for the click of the the object but it gives me an object has no method error.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T18:11:25+00:00Added an answer on May 28, 2026 at 6:11 pm

    The problem seems to be that your variable named name collides with document.name that´s undefined. Renaming the variable makes it work;

    if (el.addEventListener) {  
      el.addEventListener('click', func, false);
    } else if (el.attachEvent){  
      el.attachEvent('onclick', func); // IE < 9
    }
    

    Even this will work;

    document.getElementById("nameId").addEventListener('click', func, false);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

<form action=index.php?page=checkin method=post name=regForm> Fullständiga namn: <input name=full_name type=text id=full_name class=required> <br > Email:
<form action=index.php?page=checkin method=post name=regForm> <div id=First_1> <table width=100% cellpadding=0 cellspacing=0> <tr> <td> <table cellpadding=0
<form method=post action=sendmail.php name=Email_form> Message ID <input type=text name=message_id /><br/><br/> Aggressive conduct <input type=radio
I have this form: <form action=after.php method=post id=divulgacao> <div style=float: left;width: 195px; margin-right: 10px;>
Here is the form I am using: <form action=scripts/contactscript.php method=post id=contactform> <ol> <li> <label
How to get the type of input in the form by its name? for
I saw some code, html form code which looks like this: <form name=form1 method=post
My php form`s action goes to another page and it doesnt look good, I
I have a basic PHP form here that sends an email when submitted: <div
I have a form with a name and an email address. I want a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.