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 6648321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:38:30+00:00 2026-05-26T00:38:30+00:00

I know, this is just so common. However, I am not able to get

  • 0

I know, this is just so common. However, I am not able to get it working.

Got a php file which is included in the index.php and that contains a function printing this one out

echo "<input type=text id=test name=schuelername value=Name><br>
    <button style='float: left;' onclick='update();'>Suchen</button>";

Now I want to pass this value of the textbox. With (this is the update function)

alert(window.document.getElementById("test").value);

run by an external JS file (that works, Tested it, the only problem is the value of the textbox) isn’t showing up.

Argh. Why do I define the damn ID if JS can’t access it (or so…)

SOLVED: Well, I ran a document.write before it and I couldn’t imagine, that like this, the rest of the javascript can’t run because I just deleted everything. Thanks alot, stupid me, late!

  • 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-26T00:38:31+00:00Added an answer on May 26, 2026 at 12:38 am

    That should work. Try alert(window.document.getElementById("test").defaultValue);

    Demo: http://jsfiddle.net/AlienWebguy/RzrZZ/

    Make sure your PHP is echoing that HTML before your Javascript tries to find it and alert the value. If the actions are reversed, getElementById("test") will be undefined because the node would not have been added to the DOM yet.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Google's not coming to my rescue, here, and I just know this is the
This just won't work. The problem is that I do not know enough to
I know this has been asked different ways several times, but I'm just not
First, I know this is kind of common question, but I could not find
I know this is a very common (and basic) question, however I've tried without
I know this maybe a basic question but I just can't seem to find
I know this sounds confusing: I have just built some basic prev/next pagination for
i know this is kinda retarded but I just can't figure it out. I'm
I know this has been asked thousands of times but I just can't find
I know this is simple, I just can't recall the best way to do

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.