Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 27

Thread: Conditional Display of Form Fields

  1. #11
    Join Date
    Sep 2007
    Location
    Maui
    Posts
    647
    Thanks
    287
    Thanked 15 Times in 15 Posts

    Default

    Yes I do, right here. Maybe I'm misunderstanding.. sorry.

    Code:
    <?php if(isset($_POST['addnewloc'])) { ?>
      <div id="newloc">   <p><label for="location">New Location:</label><input type="text" name="location" size="60"></p>

  2. #12
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    But it's not being added in the page (as markup).

    View your page's source and do a ctrl+f and find newloc. (See that it does'nt exists (yet).
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  3. The Following User Says Thank You to rangana For This Useful Post:

    kuau (07-23-2008)

  4. #13
    Join Date
    Sep 2007
    Location
    Maui
    Posts
    647
    Thanks
    287
    Thanked 15 Times in 15 Posts

    Default

    I see what you mean (duh!). It was because of the
    Code:
    <?php if(isset($_POST['addnewloc'])) { ?>
    around it. Anyway, I fixed it and it works perfectly except for one detail -- I LOVE it! Exactly what I had in mind.

    The only problem is that when the page loads, the fields are showing already. If you click and then unclick, they go away. How do I make the page load with the fields hidden to start? e

  5. #14
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    See if adding the highlighted helps:
    Code:
    <div id="newloc" style="display:none;">
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  6. The Following User Says Thank You to rangana For This Useful Post:

    kuau (07-27-2008)

  7. #15
    Join Date
    Sep 2007
    Location
    Maui
    Posts
    647
    Thanks
    287
    Thanked 15 Times in 15 Posts

    Default

    Dear Rangana: That was it! It is perfect now... thank you so much. I just love it when things work in such cool ways. I would never have figured that out in a million years.

    You made my day. e

  8. #16
    Join Date
    Jan 2007
    Posts
    629
    Thanks
    10
    Thanked 28 Times in 28 Posts

    Default

    Hmm. I'm not liking your form validation. Suppose that you were color blind, how could you get past that? See the W3C's WCAG 2.0, as well.

    1.4.1 Use of Color: Color is not used as the only visual means of conveying information, indicating an action, prompting a response, or distinguishing a visual element.
    Though WCAG is often criticized, that rule makes a lot of sense. I highly suggest a new CAPTCHA program.
    Last edited by Jas; 07-27-2008 at 04:33 AM.
    --Jas
    function GreatMinds(){ return "Think Like Jas"; }
    I'm gone for a while, but in the meantime: Try using my FTP script | Fight Bot Form Submissions

  9. #17
    Join Date
    Sep 2007
    Location
    Maui
    Posts
    647
    Thanks
    287
    Thanked 15 Times in 15 Posts

    Default

    I just finished making that one myself and was quite proud of it. I figured that the small percentage of people who are colorblind could use a process of elimination and deduce the color based on the ones they could see. I don't want a difficult CAPTCHA program. Nothing ruins my day faster than not being able to get past some unintelligible CAPTCHA. I haven't even made the form live yet. Maybe it will be too easy for the bots and I'll have to change it, but right now I do not want to go back to square one. Thanks.

  10. #18
    Join Date
    Oct 2006
    Posts
    183
    Thanks
    0
    Thanked 11 Times in 11 Posts

    Default

    I love these kind: (I made it but it is like the ones I always get)



    Solve it :P

  11. #19
    Join Date
    Sep 2007
    Location
    Maui
    Posts
    647
    Thanks
    287
    Thanked 15 Times in 15 Posts

    Default

    I rest my case! haha

  12. #20
    Join Date
    Jan 2007
    Posts
    629
    Thanks
    10
    Thanked 28 Times in 28 Posts

    Default

    Quote Originally Posted by kuau View Post
    I just finished making that one myself and was quite proud of it. I figured that the small percentage of people who are colorblind could use a process of elimination and deduce the color based on the ones they could see.
    It is a nice captcha program, no doubt. But I don't think you understand color blindness very well. For one thing, there are more color blind people than you seem to think there are-- I know a few myself. For another, the "process of elemination" only works if you recognize all of the other colors, and chances are that they won't unless they are mildly color blind. In a severly color blind person, things like yellow, blue, and red can all look exactly the same. Generally speaking, color blind people can only really tell saturated colors (i.e. true red, true blue, etc). Colors like purple and blue are very hard to tell apart, and in some cases green and red, pink and purple, etc.
    I don't want a difficult CAPTCHA program. Nothing ruins my day faster than not being able to get past some unintelligible CAPTCHA.
    So you see the problem
    I haven't even made the form live yet. Maybe it will be too easy for the bots and I'll have to change it, but right now I do not want to go back to square one. Thanks.
    Understandable, but at the same time it will frustrate a lot of color blind people. Maybe a more traditional captcha program, or a random question would work better. As for the former, there is a simple version in a tutorial linked in my signature. It needs work, though, before it's actually used live. (For one thing, blind people still cannot use it, for another the hyper linked code/example don't work quite right (the posted code does).)
    Last edited by Jas; 07-27-2008 at 08:07 PM.
    --Jas
    function GreatMinds(){ return "Think Like Jas"; }
    I'm gone for a while, but in the meantime: Try using my FTP script | Fight Bot Form Submissions

  13. The Following User Says Thank You to Jas For This Useful Post:

    kuau (07-30-2008)

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
  •