Results 1 to 9 of 9

Thread: URL field not required fo me

  1. #1
    Join Date
    Sep 2002
    Posts
    1

    Default URL field not required fo me

    1. I make URL field not required in add_form
    2. On detail page printing URL: http://

    Where I must paste script something like
    PHP Code:
    if ($url == "http://"$url ""
    Sorry my english
    PS
    IndexU v. 3.04

  2. #2
    Join Date
    Sep 2002
    Posts
    60

    Default

    Hi,

    From my understanding of this, you don't need the url field to show up the detail template?

    You have two options:

    1) If you don't require the url field at all then you can remove it from the detail_link.html template.

    2) In the admin area, when you add a link, just delete the "http://" from the url field and that will remove it from the links that don't require it.

    I'm sure there are other ways using php but those seem to be the easiest as far as i can see.

    Also, and not sure if this is applicable, but if you do not require the url field to be submitted from add.php then you'll need to open up add.php and remove this line (line 158)

    elseif(empty($url) || $url == 'http://') $error_msg = $msg["10102"];

    that will save you getting an error message, when a link is added via your site.

    Hope it helps

    Rob

  3. #3
    Join Date
    May 2004
    Location
    Phoenix
    Posts
    14

    Default Not working

    I've commented our the line (see below) in add.php and modify.php:

    elseif(empty($url) || $url == 'http://') $error_msg = $msg["10102"];

    I've tried to just delete the http:// on those links for businesses that do not have websites.

    In both instatnces, I am still getting the error "URL is required."

    NOTHING IS WORKING!

    I would like the option to list a business' url if they have one or to not list one if one does not exist. Can someone help me?

  4. #4
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Default Re: Not working

    you need to edit the idx_link and idx_link_temp tables with something like phpmyadmin and change the Null column from NOT NULL TO NULL
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

  5. #5
    Join Date
    May 2004
    Location
    Phoenix
    Posts
    14

    Default Thank You

    That did the trick...although I still get the "URL is Required" error when I delete the "http://" when entering a link.

    However, I have found that I can delete the "http" and insert a space (hit the space bar once) in the URL field. This allows me to avoid the "URL is required" message and I end up with an empty URL field when detail_link is displayed.

    That will work for me.

    Thanks for your help!

  6. #6
    Join Date
    Sep 2002
    Posts
    60

    Default

    Hi,

    I've always run my programs without the need for the URL field. The easiest way is to remove line 158 in add.php.

    If you are still getting up the error message then open up msg.php and delete the info that runs element 10102, failing that if you do not want any error messages to show up at all, just take the error msg out of the add templates.

    Rob

  7. #7
    Join Date
    May 2004
    Location
    Phoenix
    Posts
    14

    Default Thanks

    Hi Rob,

    I figured out my problem. I had to comment out

    elseif(empty($url)) $error_msg = $msg["20072"]

    which is Line 70 in link_edit.php.

    No more URL field is required message.

    Thanks!

  8. #8
    Join Date
    May 2004
    Location
    New Zealand
    Posts
    600

    Default

    I love the idea that the first post had,

    if ($url == "http://") $url = "";

    Could it be something like
    if ($url == "http://") $url = "No Website";

    Where would be the best place to add that kinda code....

  9. #9
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Default

    add.php and modify.php:
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

Similar Threads

  1. Replies: 2
    Last Post: 08-05-2003, 02:16 AM
  2. New required fields
    By daweb in forum v3.2
    Replies: 3
    Last Post: 07-22-2003, 03:11 PM
  3. Replies: 26
    Last Post: 06-05-2003, 06:08 PM
  4. Creating db field with radio button or dropdown listbox
    By dody in forum Tutorials, Hints & Tips
    Replies: 4
    Last Post: 05-14-2003, 07:03 AM
  5. New field
    By Carlitus in forum v5.x
    Replies: 3
    Last Post: 10-16-2001, 07:02 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
  •