Closed Thread
Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: Checkboxes

  1. #1
    Join Date
    Apr 2009
    Location
    Trapped in my own little world.
    Posts
    2,487
    Rep Power
    33

    Checkboxes

    These guys are really bugging me.

    I'm trying to make a script that will get all elements by tag name "input", I then proceed to put a border around them all so they are easy to point out. I have noticed checkboxes do not all much of anything in FireFox. In IE I can get a border and padding etc but FireFox hates me.

    Is there anyway I can make the checkbox more noticable? I was thinking about putting in inside of a div with padding and a background but how would I do that if I just have the element by it's id? I'm not a huge fan of JS, but it seems I need to put up with it lol.

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Location
    Advertising world
    Posts
    Many

     
  3. #2
    Join Date
    Apr 2009
    Location
    Uppsala, Sweden
    Posts
    9,547
    Blog Entries
    5
    Rep Power
    98

    Re: Checkboxes

    Can't you just give the div around it an id and get it by document.GetElementByID?

  4. #3
    Join Date
    Apr 2009
    Location
    Trapped in my own little world.
    Posts
    2,487
    Rep Power
    33

    Re: Checkboxes

    The user is uploading a HTML file, I am adding a script that will find all the form fields. I can find them already now but I want them to name them all which means they have to identify them, so I am trying to add borders or something around them all.

  5. #4
    Join Date
    Apr 2009
    Location
    Uppsala, Sweden
    Posts
    9,547
    Blog Entries
    5
    Rep Power
    98

    Re: Checkboxes

    With form fields you mean all fields in a <form> or all <form>s?

  6. #5
    Join Date
    Apr 2009
    Location
    Trapped in my own little world.
    Posts
    2,487
    Rep Power
    33

    Re: Checkboxes

    Form fields as in input, select, textarea. But I'm focusing on checkboxes because all the others allow css backgrounds/borders.

  7. #6
    Join Date
    Apr 2009
    Location
    Uppsala, Sweden
    Posts
    9,547
    Blog Entries
    5
    Rep Power
    98

    Re: Checkboxes

    Can't you do something like this:

    Code:
    myField = document.GetElementByID("the_id");
    myField.outerHTML = "<div style='Styles here'>" + myField.outerHTML + "</div>";
    I haven't tried it and I'm not sure it works, it was just a thought.

  8. #7
    Join Date
    Apr 2009
    Location
    Trapped in my own little world.
    Posts
    2,487
    Rep Power
    33

    Re: Checkboxes

    outerHTML? Exactly what I was looking for buddy!

    Like I said, I'm no pro in JS lol, I never knew this existed lol.

    +Rep!

  9. #8
    Join Date
    Apr 2009
    Location
    Uppsala, Sweden
    Posts
    9,547
    Blog Entries
    5
    Rep Power
    98

    Re: Checkboxes

    If I were you I would try it before being so happy but I think it will work.

    I'm not a pro on JS either but I worked with it almost the whole time from lunch to past midnight yesterday

    Happy to help

  10. #9
    Join Date
    Apr 2009
    Location
    Trapped in my own little world.
    Posts
    2,487
    Rep Power
    33

    Re: Checkboxes

    Worked perfect in IE but FF it did not, but I found a site that had a neat script to enable it. Also tested in Safari.

    outerHTML in Firefox - JavaScript - Snipplr

  11. #10
    Join Date
    Apr 2009
    Location
    Uppsala, Sweden
    Posts
    9,547
    Blog Entries
    5
    Rep Power
    98

    Re: Checkboxes

    Nice

Closed Thread
Page 1 of 3 123 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to Reset All Checkboxes?
    By aurakami in forum C# Programming
    Replies: 4
    Last Post: 07-19-2011, 02:40 PM
  2. How to check checkboxes???
    By justsachin4u in forum PHP Development
    Replies: 3
    Last Post: 07-13-2011, 09:31 AM
  3. Checkboxes & MySQL
    By Bioshox in forum PHP Development
    Replies: 3
    Last Post: 05-20-2010, 02:05 PM
  4. validating checkboxes using jquery in a jsp page
    By newbieal in forum JavaScript and CSS
    Replies: 0
    Last Post: 12-14-2009, 07:29 AM
  5. ComboBox with CheckBoxes ..
    By Jordan-Girl in forum C# Programming
    Replies: 1
    Last Post: 07-14-2008, 03:56 PM

Tags for this Thread

Bookmarks

Posting Permissions

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