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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:56:46+00:00 2026-06-09T06:56:46+00:00

I have an image in HTML/PHP with different areas. When I click on one

  • 0

I have an image in HTML/PHP with different areas. When I click on one of the areas I want my input field above to change. How do I do that? Trying to use a normal $variable but I dont get that to work either.

I am very new to HTML.

Thanks in advance!

<input type="text" name="position" size="10" value="">

<img style="margin: 50px 500px" src="pic.jpg" width="500" height="200" alt=":("
usemap="#cabmap" />

<map name="cabmap">
<area shape="rect" coords="20,0,82,126" alt="Sun" *something here mby?* />



<html>
<head>
<title>Pos</title>
</head>

<body>

<form method="post" action="process.php">
<fieldset>
<legend><strong>ChosePos</strong></Legend>

<td style="padding-left: 40px"><b>Position</b></td>
<input id="position" type="text" name="position" size="10" value="Hellope"</input>
<br />
<img src="pic.jpg" width="500" height="200" alt="Position map" usemap="#map" />
<map name="map">
  <area shape="rect" coords="0,0,82,126" alt="CA1" onclick="javascript:simply();" />
  <script type="text/javascript">
    function simply(){
    var box = document.getElementById("position");
    box.value="Hello";
  </script>

  </map>


</fieldset>

<input style="pading-top: 20px" type="submit" value="Send report" />



</form>
</body>
</html>

Now have I’ve gotten this far but nothin happens when i click on the area…

I have no idea whats wrong. Plz help me.

  • 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-06-09T06:56:48+00:00Added an answer on June 9, 2026 at 6:56 am

    UPDATE – if this is still marked as the “correct” answer…

    I have tried explaining to the OP that my answer was based on the errors they had introduced when implementing the changes suggested by user1474090. And as a result, they should mark the answer from user1474090 as the “correct” one… and not this one.


    Original Answer

    In response to your updated question, you have a couple of syntax errors.

    Firstly, your <input id="position" is badly formatted, so change…

    <input id="position" type="text" name="position" size="10" value="Hellope"</input>
    

    Into one of the following two lines…

    <input id="position" type="text" name="position" size="10" value="Hellope"></input>
    <input id="position" type="text" name="position" size="10" value="Hellope"/>
    

    Secondly, your JavaScript function doesn’t have a close brace }, so change…

    <script type="text/javascript">
      function simply(){
      var box = document.getElementById("position");
      box.value="Hello";
    </script>
    

    To…

    <script type="text/javascript">
      function simply(){
        var box = document.getElementById("position");
        box.value="Hello";
      }
    </script>
    

    I would also suggest that you move the <script> block into the <head> section of your page, rather than being part of the <body>. This is not vital for it to work, but it is the preferred way of having scripts in your page.

    And I can thoroughly recommend FireBug for Firefox or use the developer components in Chrome and IE8/9 (F12 for both). These would very quickly allow you find issues like this.

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

Sidebar

Related Questions

i have one image in my html and i have 5 different link, i
I have this code snippet in an email layout: <div> <?php echo $this->Html->image('Layouts/default/Logo.png', array(
I have a few html image tags that fill an array. On the page
I have a string that contains HTML image elements that is stored in a
I have populated an array with a few html image tags that I have
Change all links that have an image in it to: javascript(alert(thehref)); eg. <a href=/galleries/anna-leah-111827/image01.html><img
I have the following html code: I saw that for Watir-webdriver the Watir::Image.file_size method
Background: I have string of html with about 10 image tags that passes through
I have the following image in a CMS that I want to hide, I
I have a image that I want to display a DIV on the bottom

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.