Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Mar 2009
    Posts
    74
    Thanks
    2
    Thanked 0 Times in 0 Posts

    insert image between text by promptBox(javascript)

    hey i need to insert image between text by javascript promptBox. know it is easy and i tried several times but i did not get successs.

    please any one give me the code of inserting image between text.
    please helo me out!!!!!!!!!!!
    Last edited by deshi2003; 03-19-2009 at 01:17 AM.

  • #2
    Regular Coder
    Join Date
    Mar 2009
    Location
    Portland Oregon
    Posts
    690
    Thanks
    44
    Thanked 63 Times in 62 Posts
    Hmmm
    what do you mean?

    show us your code

  • #3
    Regular Coder
    Join Date
    Mar 2009
    Location
    Portland Oregon
    Posts
    690
    Thanks
    44
    Thanked 63 Times in 62 Posts

  • #4
    New Coder
    Join Date
    Mar 2009
    Posts
    74
    Thanks
    2
    Thanked 0 Times in 0 Posts

    my code as wanted (inserting image url by javascript prompt box )

    Code:
    <!_ Entering custom image--?
    <html>
    <head>
    <script type="text/javascript">
    function disp_prompt()
    {
    var image_ url=prompt("Please enter your image url","http://");
    if (name!=null && name!="")
      {
       image_ url="<img src='"+image_ url+"'/>";
      //document.write(image_ url);
      }
    }
    </script>
    </head>
    <body>
    
    <input type="button" onclick="disp_prompt()" value="Display a prompt box" />
    
    </body>
    </html>
    please help me

  • #5
    Regular Coder
    Join Date
    Mar 2009
    Location
    Portland Oregon
    Posts
    690
    Thanks
    44
    Thanked 63 Times in 62 Posts
    http://javascript.internet.com/forms...d-preview.html

    here's a script all ready for you

  • #6
    Regular Coder
    Join Date
    Mar 2009
    Location
    Portland Oregon
    Posts
    690
    Thanks
    44
    Thanked 63 Times in 62 Posts
    Code:
    <html>
    <head>
    <script type="text/javascript">
    function disp_prompt()
    {
    var image_ url=prompt("Please enter your image url","http://");
    if (name!=null && name!="")
      {
       image_ url="<img src='"+image_ url+"'/>";
      //document.write(image_ url);
      }
    }
    </script>
    </head>
    <body>
    
    <input type="file" onclick="disp_prompt()" value="Display a prompt box" />
    
    </body>
    </html>
    this needed to be type="file"
    Works!!!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •