Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: General / Classic ASP versions(v3.4.XX)
 Default text in message area?
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

sikandar
Junior Member

Pakistan
135 Posts

Posted - 06 November 2009 :  10:05:49  Show Profile
Hi,
Where I can makes changes to show some default text in a new topic message area?

Thanks

sikandar
Junior Member

Pakistan
135 Posts

Posted - 09 November 2009 :  08:11:43  Show Profile
Waiting for any update? thanks
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 09 November 2009 :  09:22:38  Show Profile  Visit MarcelG's Homepage
The basic principle is this: http://htmlhelp.com/reference/wilbur/form/textarea.html
E.g. in pseudo HTML:
<textarea>default text</textarea>

This is stored in POST.ASP.
Look for this code (line 826 in POST.ASP version 3.4.07
"                <td bgColor=""" & strPopUpTableColor & """>
<textarea cols=""" & intCols & """ name=""Message"" rows=""" & intRows & """ wrap=""VIRTUAL"" onselect=""storeCaret(this);"" onclick=""storeCaret(this);"" onkeyup=""storeCaret(this);"" onchange=""storeCaret(this);"">" & Trim(CleanCode(TxtMsg)) & "</textarea><br /></td>" & vbNewLine & _

However, as you can see this textarea box already has some code snippets added, with the storeCaret function.
I must admit I am unfamiliar with this snippet...

I think the following approach might work.
On line 824 find this:
			"                  </table>" & vbNewLine & _
			"                </font></td>" & vbNewLine & _

Replace it by this:
			"                  </table>" & vbNewLine 
If Trim(CleanCode(TxtMsg)) = "" then
'The TxtMsg is empty, fill it with the default text.
'Change the value below to suit your own needs.
TxtMsg = "Your default text"
end if
Response.write			"                </font></td>" & vbNewLine & _

Beware, this is NOT tested!

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 09 November 2009 :  09:52:00  Show Profile  Visit AnonJr's Homepage
Unless he's asking about how to add something like the "Before posting, make sure you have read this topic!" bit we have here... the question is a bit unclear...
Go to Top of Page

sikandar
Junior Member

Pakistan
135 Posts

Posted - 11 November 2009 :  10:35:12  Show Profile
Hi,
Thanks for all shared so for. Let me explain in detail. I want if someone clicks "New Topic" to create new topic so I want to have some text displaying by default. While replying no need to have any default text. Actually I was to give some default questions so people should give that info in the message body while creating topic first time.

Hope now point is clear and if still not please let me know.

Thanks
Go to Top of Page

sikandar
Junior Member

Pakistan
135 Posts

Posted - 11 November 2009 :  12:18:56  Show Profile
The following code is nice except it is populating when replying but I need only for new topic seems need to put another if condition?

Thanks
Replace it by this:
" </table>" & vbNewLine
If Trim(CleanCode(TxtMsg)) = "" then
'The TxtMsg is empty, fill it with the default text.
'Change the value below to suit your own needs.
TxtMsg = "Your default text"
end if
Response.write " </font></td>" & vbNewLine & _
Go to Top of Page

Etymon
Advanced Member

United States
2396 Posts

Posted - 11 November 2009 :  23:41:11  Show Profile  Visit Etymon's Homepage
I'm not looking at the code on this, but you would want something like this:

If Trim(CleanCode(TxtMsg)) = "" and strMethod = "Topic" then
Go to Top of Page

Carefree
Advanced Member

Philippines
4222 Posts

Posted - 12 November 2009 :  04:38:13  Show Profile
quote:
Originally posted by Etymon

I'm not looking at the code on this, but you would want something like this:

If Trim(CleanCode(TxtMsg)) = "" and strMethod = "Topic" then


That should say:
If Trim(CleanCode(TxtMsg)) = "" and strRqMethod = "Topic" then
Go to Top of Page

Etymon
Advanced Member

United States
2396 Posts

Posted - 12 November 2009 :  05:00:24  Show Profile  Visit Etymon's Homepage
Yeah, there you go. I knew I was off somewhere.
Go to Top of Page

sikandar
Junior Member

Pakistan
135 Posts

Posted - 13 November 2009 :  14:25:38  Show Profile
Great MarcelG & Carefree, it worked for me. Now I am looking for another condition in which I want to check to appear this in specific forums not for all. Like for example,

If forums = "Help: General / Current Version (v3.4.xx)" then display....

Thanks
Go to Top of Page

Etymon
Advanced Member

United States
2396 Posts

Posted - 14 November 2009 :  00:54:42  Show Profile  Visit Etymon's Homepage
You will have to compare against the forum's numeric value instead of it's text description.

Here at Snitz the forum you referenced "Help: General / Current Version (v3.4.xx)" has the numeric forum id of 111, so you would write your code like this:

If forums = "111" then
display....
end if

Edited by - Etymon on 14 November 2009 00:55:26
Go to Top of Page

sikandar
Junior Member

Pakistan
135 Posts

Posted - 14 November 2009 :  04:05:55  Show Profile
Hi,
You mean "If forums =" in this forums is a variable and it contains the forum number. I will take the number no issue but with what to compare? I am guessing it should be like forum_id etc.

thanks

Edited by - sikandar on 14 November 2009 05:03:27
Go to Top of Page

Etymon
Advanced Member

United States
2396 Posts

Posted - 14 November 2009 :  20:25:09  Show Profile  Visit Etymon's Homepage
Yes, that is correct ... I understood that forums is a variable and you were most likely meaning forum_id.

For the sake of argument let's say this:

Dim forums

forums = strRqForumID


With this in mind, it seems that you want your special text to appear only in specific forums where a member is posting a new topic. Say you have five forum ids .... 1, 2, 3, 4, and 5. Perhaps forum ids 2, 4, and 5 are the ones where you want the special text to appear in the post's Message: textarea. If this is the case, then you can do it this way:

if forums = "2" or forums = "4" or forums = "5" then
     display....
end if


Edited by - Etymon on 14 November 2009 20:34:04
Go to Top of Page

sikandar
Junior Member

Pakistan
135 Posts

Posted - 17 November 2009 :  13:25:03  Show Profile
Hi,
Will try and will get back to you thanks.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.42 seconds. Powered By: Snitz Forums 2000 Version 3.4.07