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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:08:41+00:00 2026-06-04T04:08:41+00:00

I have this code http://jsfiddle.net/xNHKP/6/ (not working in the fiddle for some reason which

  • 0

I have this code http://jsfiddle.net/xNHKP/6/ (not working in the fiddle for some reason which i dont get, but it works on my site – http://bit.ly/JV5I0Z )

What i want is that the contact form (click last menu item to make it appear) can be dragged, but when someone drags or clicks on the text fields, they do not gain focus and so you can’t type in them. Ironically, it works on internet explorer.

So how can i make the fields gain focus when clicked on? I don’t mind making them non-draggable.

Thanks

edit: code below (tried to keep it as simple as possible, including only the relevant stuff)

dragDrop = {
initialMouseX: undefined,
initialMouseY: undefined,
startX: undefined,
startY: undefined,
draggedObject: undefined,

initElement: function (element) {
    if (typeof element == 'string')
        element = document.getElementById(element);
    element.onmousedown = dragDrop.startDragMouse;
}}

<form id="contactForm" onSubmit="return sendMail();">
  <textarea id="message" rows="8"></textarea>
</form>

<script type="text/javascript">
  dragDrop.initElement(document.getElementById('contactForm'));
</script>
  • 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-04T04:08:42+00:00Added an answer on June 4, 2026 at 4:08 am

    Okay, seems you’re struggling with it, here’s what would I do considering what you want :

    • addEventlistener to your form, make it not bubble so if you click on an inner element it doesn’t trigger.
    • let every inner element live it’s life like usual, don’t try to add messy events on them.

    If you really want/need the user to be able to drag the form by dragging on a label or something you should explicitely filter what are the draggable elements. Then you can go back to a bubbling event and filter out what’s not draggable. If it’s not draggable, don’t do anything else than a return so you don’t have trouble with text selection.

    Here’s a fiddle

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

Sidebar

Related Questions

ok I have this small code http://jsfiddle.net/laupkram/yJtyD/ now its not really working. I had
Here is some code I modified from this nifty site : http://jsfiddle.net/Ajhka/ I have
All of this is code is here: http://jsfiddle.net/yrgK8/ I have a news section which
I have this code: http://jsfiddle.net/AH4As/3/ It works in the fiddle, but on my site,
I have this code I'm working on, see link: http://jsfiddle.net/PqsAD/3/ The problem is depending
I have this code http://jsfiddle.net/Kbzgd/ what i'm trying to do is on the top
I have this code : http://jsfiddle.net/VAkLn/6/ When i add a table : http://jsfiddle.net/VAkLn/7/ this
I have this code: http://jsfiddle.net/bUPWS/1/ but #div2 overflows #div1. How to bring the overflowed
This is my code http://jsfiddle.net/Cfa6c/8/ Basically what I need to do is get the
I have the following code: http://jsfiddle.net/SPWWx/ I'm completely new to javascript, this is my

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.