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
    Jan 2013
    Posts
    2
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Modify search form to include hidden tag

    Hey guys, I've just been vilified over at Stack Exchange for even posting this - some people are too uptight.

    I've tried this myself for the last 2 hours without success before I found this website. I'm hoping someone can help me.

    I have a Tumblr blog (of adult nature) which uses tags as a core navigational tool.

    I have a search box on my page which users can use to find things.

    Now, heres the problem: Tumblr's tagging system pools all tags into the main site. I recently got a complaint about one of the tags I was using and wanted to fix the issue.

    One of the tags I use is 'kitten', which is the name of a well known adult movie star. Now, if you're on my blog and you type in 'kitten' into the search bar all posts of this person will appear. No problem here. Unfortunately, they also appear on the main Tumblr tags page and people searching for 'kitten' hoping to see a cute, fluffy cat end up seeing a pussy (couldn't resist, sorry). I'm a good person and obviously I take this very seriously because I don't want people searching for kittens to see something of an adult nature. Which is why I want to actively look for a solution rather than ignore the request. I promised the person who brought this to my attention that I'd try and fix it. It will take weeks of manually renaming tags but the plan is to manually all tags, for example 'kitten' to 'kitten@mysite.com'. This will absolutely guarantee that my tags will never crop up in the main tags section.

    The code I'm working with is this:



    Where {text:Search Label} calls to an editable text field which currently says 'Find by name'

    I don't know where or how to edit it so that the yielded results will display the extra part. So if someone types in 'kitten', as per the code above, the yielded term is 'kitten'. How can I change it so that if someone types in 'kitten', the yielded results show 'kitten@mysite.com'

    I hope somebody can help me as I would really like a friendly tagging system. I wouldn't want persons under 18 seeing stuff of adult nature.

    Thanks - a responsible blogger.

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,683
    Thanks
    25
    Thanked 656 Times in 655 Posts
    Not an answer, this is beyond me, but we inclose code in [code] tags generated by hitting the # above you in the message box. I hope I translated you code correctly. If not please redo it.
    Code:
    <form onsubmit="return tagSearch(this)">
    <input type="submit" value = "Go" />
    <input type ="text" name="tag" value="{text:Search Label}" onfocus="if (this.value == '{text:Search Label}') {text.value = ''}" onblur = "if (this.value == '') {this.value = '{text:Search Label}'}" />
    </form>

  • Users who have thanked sunfighter for this post:

    JohnHamm (01-09-2013)

  • #3
    New Coder
    Join Date
    Dec 2012
    Location
    USA
    Posts
    82
    Thanks
    3
    Thanked 17 Times in 17 Posts
    I'm not sure what your 'tagSearch' function is doing, but within that function add what I put in my tagSearch function below, that should do it.

    Code:
    <script type="text/javascript">
    function tagSearch(value){
    	document.searchForm.tag.value += '@mysite.com';
    }
    </script>
    
    <form name="searchForm" onsubmit="return tagSearch(this);">
    	<input type="submit" value = "Go" />
    	<input type="text" name="tag" value="{text:Search Label}"
    		onfocus="if (this.value == '{text:Search Label}') {text.value = ''}"
    		onblur = "if (this.value == '') {this.value = '{text:Search Label}'}" />
    </form>
    Last edited by TFlan; 01-09-2013 at 05:13 AM.

  • Users who have thanked TFlan for this post:

    JohnHamm (01-09-2013)

  • #4
    New to the CF scene
    Join Date
    Jan 2013
    Posts
    2
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Thank you so much for this, it works perfectly.

    I've thanked you both for your posts.

    This thread can be closed now.

    Thanks again!

    Quote Originally Posted by TFlan View Post
    I'm not sure what your 'tagSearch' function is doing, but within that function add what I put in my tagSearch function below, that should do it.

    Code:
    <script type="text/javascript">
    function tagSearch(value){
    	document.searchForm.tag.value += '@mysite.com';
    }
    </script>
    
    <form name="searchForm" onsubmit="return tagSearch(this);">
    	<input type="submit" value = "Go" />
    	<input type="text" name="tag" value="{text:Search Label}"
    		onfocus="if (this.value == '{text:Search Label}') {text.value = ''}"
    		onblur = "if (this.value == '') {this.value = '{text:Search Label}'}" />
    </form>


  •  

    Posting Permissions

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