SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Enthusiast storkfmny's Avatar
    Join Date
    Mar 2012
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question One validation error that I can't figure out!

    I had several errors and figured them all out but this one. I tried doing what they are telling me is wrong and it creates another error. Anyway, here's my problem...I am being told that a required attribute "action" not specified. <form> is where they tell me the problem is and here is the code...
    Code:
    <form>
    <input type="button" value=0  style="color: #0066E7; border: 6px solid #0066E7; background-color: silver;" onclick="(s=0)"><br>
    <input type="button" value=1 style="color: #0066E7; border: 6px solid #0066E7; background-color: silver;" onclick="(s=10)"><br>
     <input type="button" value=2 style="color: #0066E7; border: 6px solid #0066E7; background-color: silver;" onclick="(s=20)"><br>
    <input type="button"  value=3 style="color: #0066E7; border: 6px solid #0066E7; background-color: silver;" onclick="(s=30)"> <br>
    <input type="button" value=4 style="color: #0066E7; border: 6px solid #0066E7; background-color: silver;" onclick="(s=40)"> <br>
    <input type="button"  value=5 style="color: #0066E7; border: 6px solid #0066E7; background-color: silver;" onclick="(s=50)"><br>
    <input type="button"  value=6 style="color: #0066E7; border: 6px solid #0066E7; background-color: silver;" onclick="(s=60)"><br>
    <input type="button" value=7 style="color: #0066E7; border: 6px solid #0066E7; background-color: silver;" onclick="(s=70)"><br>
    <input type="button" value=8  style="color: #0066E7; border: 6px solid #0066E7; background-color: silver;" onclick="(s=80)"><br>
    <input type="button"  value=9 style="color: #0066E7; border: 6px solid #0066E7; background-color: silver;" onclick="(s=90)"><br>
     </form>
    What is it exactly they are trying to tell me should be in the form element?

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,171
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    The data entered into a form is normally processed by some kind of program, such as PHP. So forms expect to have an "action" attribute that specifies a link to the script that will process the forum. You can leave it blank if you want:

    Code:
    <form action="" method="post">
    ...
    </form>
    What is your code meant to do, by the way? Do you really need a form for this? Inline JS like that is not ideal. It's best to create something that will work (or do something useful) even if JS is off.

  3. #3
    SitePoint Enthusiast storkfmny's Avatar
    Join Date
    Mar 2012
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    The data entered into a form is normally processed by some kind of program, such as PHP. So forms expect to have an "action" attribute that specifies a link to the script that will process the forum. You can leave it blank if you want:

    Code:
    <form action="" method="post">
    ...
    </form>
    What is your code meant to do, by the way? Do you really need a form for this? Inline JS like that is not ideal. It's best to create something that will work (or do something useful) even if JS is off.
    This is a user side variable control for a timer counting speed...0-90ms timeout function call.
    It looks good on the page and users like interaction so I gave them a little extra and it works good.
    If I leave this blank, will it have a negative impact on page ranking for search engines?
    Appreciate the input (pun intended).

  4. #4
    SitePoint Enthusiast storkfmny's Avatar
    Join Date
    Mar 2012
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I inserted your code into the form element and passed validation! Feels like graduation day haha, they even gave me code for a valid code icon.
    Thanks

  5. #5
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,826
    Mentioned
    73 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by storkfmny View Post
    I inserted your code into the form element and passed validation! Feels like graduation day haha, they even gave me code for a valid code icon.
    Thanks
    Try this:

    HTML Code:
    <! doctype html>
    <html>
    <head>
      ...
      ...
      <style type='text/css'>
        #form_div input
        {
           display:block; margin-bottom:1em; color: #0066E7; border: 6px solid #0066E7; background-color: silver
        }
      </style>
    </head>
    <body>
      
      <form action="#" method="post">
        <div id='form_div'>   
          <input type="button" value='0'  onclick="(s=0)"  />
          <input type="button" value='1'  onclick="(s=10)" />
          <input type="button" value='2'  onclick="(s=20)" />
          <input type="button" value='3'  onclick="(s=30)" /> 
          <input type="button" value='4'  onclick="(s=40)" /> 
          <input type="button" value='5'  onclick="(s=50)" />
          <input type="button" value='6'  onclick="(s=60)" />
          <input type="button" value='7'  onclick="(s=70)" />
          <input type="button" value='8'  onclick="(s=80)" />
          <input type="button" value='9'  onclick="(s=90)" />
        </div>
      </form>
           
    </body>
    </html>
    Is it possible to see a working version?
    Last edited by John_Betong; May 7, 2012 at 15:03. Reason: formatting and spellling: not my fortay

  6. #6
    SitePoint Enthusiast storkfmny's Avatar
    Join Date
    Mar 2012
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    John, I tried doing what your code does and failed but mine didn't work because it was written wrong and I see where I went wrong by looking at yours. I am using an external css style sheet and just couldn't make it work so I went with the inline style and it works so I'm not gonna "fix" it. I am still a newb at this stuff (my first site) and I will show the site when it's launched in the next week or so. I would have to give you the home page and the css page for it to make any sense.
    I think it looks pretty good but of course I am a little biased, I'll be sure to post it on this forum when it's up and running.
    I thank you for your time and offering and will try your code in a bit, I am a little burned out on this site right now and need a break from it. Thanks to all who have helped!

  7. #7
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,810
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Have you tested the page with JavaScript turned off so as to see the page the way somewhere between 5 and 10% of your visitors will see it?
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  8. #8
    SitePoint Enthusiast storkfmny's Avatar
    Join Date
    Mar 2012
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    Have you tested the page with JavaScript turned off so as to see the page the way somewhere between 5 and 10% of your visitors will see it?
    I knew there was something I was forgetting, I must let everyone know that javascript must be enabled.
    This entire site is based on the functions of the javascript code and is worthless and senseless without it.
    Many of you will probably think it's a goofy site but many out there will not and that's what I'm counting on.
    I'm waiting on my paypal verification to launch. I opened a new checking account just for paypal. Heard too many horror stories of accounts being shut down to mess up my other checking account, taking no chances there.
    Hopefully launching by early next week, I'll post then. Thanks felgall!
    I have been unable to find another site even remotely like mine and hope people enjoy it.
    Last edited by storkfmny; May 8, 2012 at 17:28. Reason: forgot something

  9. #9
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,171
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by storkfmny View Post
    I must let everyone know that javascript must be enabled.
    This entire site is based on the functions of the javascript code and is worthless and senseless without it.
    At the end of the day, you are presumably offering up content of some sort, so the ideal is to make that somehow available to everyone—even if the experience isn't so great with JS off. It may take a little extra effort, but really needn't do if you start with the content and then add the JS on top of that. It's an ideal to aim for, anyway.


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
  •