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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:56:24+00:00 2026-05-24T12:56:24+00:00

I have a HTMl form <form action= method=post enctype=multipart/form-data> <p> Banner Ad Name :<br

  • 0

I have a HTMl form

<form action="" method="post" enctype="multipart/form-data">
    <p>
        Banner Ad Name :<br />
        <input type="text" name="bannerAdName" id="bannerAdName" />
    </p>
    <p>
        Your web page :<br />
        <input type="text" name="bannerAdWeb" id="bannerAdWeb" />
    </p>
    <p>
        Ad image :<br />
        <input type="file" name="bannerAdImage" id="bannerAdImage"/>
    </p>
    <p>
        Title :<br />
        <input type="text" name="bannerAdTitle" id="bannerAdTitle" />
    </p>
    <p>
        Description :<br />
        <textarea name="bannerAdDesc" id="bannerAdDesc" ></textarea>
    </p>
    <div id="button"><input type="button" value="VIEW" onclick="return upload()"/></div>

    <input type="hidden" value="POST" />
</form>

And a Javascript

<div id="banAdT">

                                   <script>
                        document.getElementById("bannerAdWeb").onchange = function() {
                        document.getElementById("banAdT").innerHTML = '<a href="'+this.value+'">';
                        }
                    </script>

                    <script>
                        document.getElementById("bannerAdTitle").onchange = function() {
                        var u = this.value;
                        document.getElementById("banAdT").innerHTML += u;
                        document.getElementById("banAdT").innerHTML += '</a>';
                        alert(document.getElementById("banAdT").innerHTML);
                        }
                    </script> 
    </div>

I am expecting the alert to show something like <a href="someurl">Some Title</a> . But instead it shows <a href="someurl"></a>Some Title ! Please help..I can’t find where I have done the wrong

  • 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-24T12:56:25+00:00Added an answer on May 24, 2026 at 12:56 pm

    Try something like this:

                <script>
                    document.getElementById("bannerAdWeb").onchange = function() {
                    document.getElementById("banAdT").innerHTML = '<a id="bandAdTLink" href="'+this.value+'"></a>';
                    }
                </script>
    
                <script>
                    document.getElementById("bannerAdTitle").onchange = function() {
                    var u = this.value;
                    document.getElementById("bandAdTLink").innerHTML += u;
                    alert(document.getElementById("banAdT").innerHTML);
                    }
                </script>
    

    Solution explanation: you should never insert invalid HTML into the DOM via javascript.

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

Sidebar

Related Questions

I have the following html code : <form name=uploadForm action= method=POST enctype=multipart/form-data> <input type=file
If I have a html form like the following: <form name=statusForm action=post.php method=post enctype=multipart/form-data>
I have an HTML form: <form action='process.php' method='post'> <input type='checkbox' name='check_box_1' /> Check me!<br>
I have this html form <form enctype=multipart/form-data action=upload.php method=POST> <textarea rows=5 cols=50 name=links id=links
i have this html <ul> <li><form action=# name=formName></li> <li><input type=text name=someName /></li> <li><input type=text
Hi I have the following code in my grails gsp <form action=upload-script-url method=post enctype=multipart/form-data>
I have a post html form, and the action is index.php, which is the
I have a HTML form containing checkboxes in the form of .. <input type=checkbox
I use fileuploader Jquery, I tried to form defined as follows: <Form enctype="multipart/form-data" action="<%:Url.Action("Edit","Ticket")%>"
I have an included object's form: <form method=post class=object_form id=event-core-form action={% url save_event_core_data event.id

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.