Author |
Topic  |
|
sikandar
Junior Member
 
Pakistan
135 Posts |
Posted - 06 November 2009 : 10:05:49
|
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
|
Waiting for any update? thanks |
 |
|
MarcelG
Retired Support Moderator
    
Netherlands
2625 Posts |
Posted - 09 November 2009 : 09:22:38
|
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
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 |
 |
|
AnonJr
Moderator
    
United States
5768 Posts |
Posted - 09 November 2009 : 09:52:00
|
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... |
 |
|
sikandar
Junior Member
 
Pakistan
135 Posts |
Posted - 11 November 2009 : 10:35:12
|
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 |
 |
|
sikandar
Junior Member
 
Pakistan
135 Posts |
Posted - 11 November 2009 : 12:18:56
|
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 & _
|
 |
|
Etymon
Advanced Member
    
United States
2396 Posts |
Posted - 11 November 2009 : 23:41:11
|
I'm not looking at the code on this, but you would want something like this:
If Trim(CleanCode(TxtMsg)) = "" and strMethod = "Topic" then |
 |
|
Carefree
Advanced Member
    
Philippines
4222 Posts |
Posted - 12 November 2009 : 04:38:13
|
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 |
 |
|
Etymon
Advanced Member
    
United States
2396 Posts |
Posted - 12 November 2009 : 05:00:24
|
Yeah, there you go. I knew I was off somewhere.  |
 |
|
sikandar
Junior Member
 
Pakistan
135 Posts |
Posted - 13 November 2009 : 14:25:38
|
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 |
 |
|
Etymon
Advanced Member
    
United States
2396 Posts |
Posted - 14 November 2009 : 00:54:42
|
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 |
 |
|
sikandar
Junior Member
 
Pakistan
135 Posts |
Posted - 14 November 2009 : 04:05:55
|
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 |
 |
|
Etymon
Advanced Member
    
United States
2396 Posts |
Posted - 14 November 2009 : 20:25:09
|
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 |
 |
|
sikandar
Junior Member
 
Pakistan
135 Posts |
Posted - 17 November 2009 : 13:25:03
|
Hi, Will try and will get back to you thanks. |
 |
|
|
Topic  |
|