PM link - Autofill subject
3 posters
Page 1 of 1
PM link - Autofill subject
I'd like to request a little help here, if I may.
Now, it's possible to create a link that would open the PM window to send a message to a certain user, but is it possible to create a link that automatically fills the subject of the PM, too?
For example, when a link directs to this URL: http://www.thesonicfamily.com/privmsg?mode=post&u=4, it opens the "Send Private Message" window (for the person who's already registered and logged in on the forum) to send a PM to user #4 (that's what u=4 stands for in the link), but is it possible to add further parameters to the URL, such as the subject of the message being composed? I tried adding "&subject=Text", but it didn't work. Is there any way to do this?
Now, it's possible to create a link that would open the PM window to send a message to a certain user, but is it possible to create a link that automatically fills the subject of the PM, too?
For example, when a link directs to this URL: http://www.thesonicfamily.com/privmsg?mode=post&u=4, it opens the "Send Private Message" window (for the person who's already registered and logged in on the forum) to send a PM to user #4 (that's what u=4 stands for in the link), but is it possible to add further parameters to the URL, such as the subject of the message being composed? I tried adding "&subject=Text", but it didn't work. Is there any way to do this?
Re: PM link - Autofill subject
Try this script :
- Code:
$(function(){
if (GetParam("mode") + GetParam("u") == "post4") $("input[name='subject']").val("TEXT");
});
Re: PM link - Autofill subject
No, there's no parameter for filling the subject field.
You could try something like this:
Or you could try the post above, but I doubt it will work because you'd need the function getParam().
You could try something like this:
- Code:
$(function(){
var form = document.post;
if(form && form.mode == 'post' && form.action == '/privmsg') {
if(document.getElementById('username').value == 'USERNAMEOFPERSON') {
form.subject.value = 'SUBJECT HERE';
}
}
});
Or you could try the post above, but I doubt it will work because you'd need the function getParam().
LGforum- Hyperactive
- Posts : 2265
Reputation : 264
Language : English
Location : UK
Re: PM link - Autofill subject
I wouldn't say it's available in phpbb3 then. Use a console, getParam is undefined. So can't be used as a function.
LGforum- Hyperactive
- Posts : 2265
Reputation : 264
Language : English
Location : UK
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum