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 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jul 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    help with submit box

    hi guys i was wondering if any one can help me out..

    there is a url box line
    then a submit button
    and i want it to paste on the same page in a box below
    the submit button going from top to bottom (new to old)
    any users/guests can submit a link on my page..

    <html>
    <head>
    <title>Redirector</title>
    <script type="text/javascript">
    function goToUrl() {
    var url = document.getElementById("urlHolder").val…
    if (url=="")
    alert("Enter a URL");
    else
    {
    window.location=url;
    }

    }
    </script>

    </head>
    <body>

    <input type="text" id="urlHolder" name="urlHolder"/></br>
    <input type="button" id="goButton" value="Submit" onclick="goToUrl();" /><a href="#" onclick="goToUrl();">Submit</a>

    </body>
    </html>

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,303
    Thanks
    23
    Thanked 612 Times in 611 Posts
    You have a button and next to it an anchor that does the same thing:
    Code:
    <input type="button" id="goButton" value="Submit" onclick="goToUrl();" /><a href="#" onclick="goToUrl();">Submit</a>
    Remove the anchor
    Code:
    <input type="button" id="goButton" value="Submit" onclick="goToUrl();" />
    Only.

    Please to note that the url MUST start with "https://" I'm sure people doing this will not do that so it becomes your responsibility. Next you need to check that it ends in a .com or .net etc.

    Lastly you need to STORE the urls. And display them as you said. just to see if this will work for you I suggest a simple text file.

    Hope this gets you going in the right direction.

  • #3
    Regular Coder
    Join Date
    Jul 2012
    Location
    London
    Posts
    473
    Thanks
    4
    Thanked 86 Times in 86 Posts
    They're submitting a url then people can view what they submitted?

    If so, I don't see any db connections made, how are you ment to store the urls? Unless your using a XML file o.O

  • #4
    New to the CF scene
    Join Date
    Jul 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hi guys. yes iam useing .xml my blog temp sry i am new at this if u can help me that would be great
    i just need it to go on the same page when they submit a link..
    Last edited by philysworld; 07-30-2012 at 09:55 PM.


  •  

    Posting Permissions

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