vForums Support Banner



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Database of Codes/Hacks/Mods :: URL Prompt Box - View Topic
Topic Rating: *****
Printable View
Marc
vChat Developer
*****
I <3 Rossy

Posts: 3,388
Status: Offline
Gender: Male
Location: Ontario, Canada
Age: 32
Joined:  

Additional Groups:
Coding Team
***


Reputation: 40%  


pmwww
URL Prompt Box (26th Mar 08 at 3:15am UTC)
This code makes a prompt box appear when your users click on the url ubbc button and asks them for the link's information, then automatically displays it in the textbox.

Preview

Code:
 
  1. <script type="text/javascript">
  2. <!--
  3. /*
  4. URL Prompt by Cr0w
  5. Copyright 2008
  6. Do not repost
  7. */
  8.  
  9. function urlPrompt(){
  10.     var url = prompt("What is the location you would like to link to?","http://");
  11.     if(url != "" && url != null){
  12.         var urlName = prompt("What would you like to name the link?","");
  13.         if(urlName != "" && urlName != null){
  14.             if(document.post_form){
  15.                 document.post_form.message.value += "[url=" + url + "]" + urlName + "[/url]";
  16.             }
  17.             else if(document.quick_reply_form){
  18.                 document.quick_reply_form.message.value += "[url=" + url + "]" + urlName + "[/url]";
  19.             }
  20.         }
  21.     }
  22. }
  23.  
  24. if(get('ubbc_buttons','id')){
  25.     get('ubbc_buttons','id').getElementsByTagName("a")[8].setAttribute("onclick","urlPrompt()");
  26. }
  27. else if(get('quick_reply_ubbc','id')){
  28.     get('quick_reply_ubbc','id').getElementsByTagName("a")[8].setAttribute("onclick","urlPrompt()");
  29. }
  30. //-->
  31. </script>
 


Global Footers. {Smile}

rroll.to— Shorten a link, rickroll your friends.
CåñåÐå™
Full Member
***

[Avatar]

Posts: 427
Status: Offline
Gender: Male
Location: Toronto Ontario
Joined:  
Reputation: 7%  


pmwww
Re: URL Prompt Box (26th Mar 08 at 5:29am UTC)
You forgot to say it goes in Global Footers {Grin} .

Image
click here We have 15 Different Skins/Templates for your vForum
Marc
vChat Developer
*****
I <3 Rossy

Posts: 3,388
Status: Offline
Gender: Male
Location: Ontario, Canada
Age: 32
Joined:  

Additional Groups:
Coding Team
***


Reputation: 40%  


pmwww
Re: URL Prompt Box (26th Mar 08 at 7:24am UTC)
Lies. {Tongue Out}

rroll.to— Shorten a link, rickroll your friends.
 Printable View

All times are GMT+0 :: The current time is 7:42pm
Page generated in 0.1346 seconds
This Forum is Powered By vForums (v2.4)
Create a Forum for Free | Find Forums