vForums Support > Programming & Coding :: Code Requests & Support :: > [F] drop down smileys code

[F] drop down smileys code - Posted By Danny (schnooble) on 30th Dec 07 at 7:57pm
for some reason instead of the drop down box showing up it says null. {Unsure}

Code:
 
  1. <script type="text/javascript">
  2. <!--
  3.  
  4. if(location.href.match(//post//)){
  5. var getRow = document.getElementsByTagName("tr");
  6. for(x=0; x<getRow.length; x++){
  7. if(getRow[x].cells[0].innerHTML.match(/Smilies/i) && getRow[x].cells[0].width == '15%'){
  8. var drop = document.getElementById("dropDown");
  9. getRow[x].cells[1].innerHTML = drop;
  10. }
  11. }
  12. }
  13.  
  14. //-->
  15. </script>
  16.  
  17.  
  18. <div id="dropDown">
  19. <form action="#">
  20. <select name="ubbc">
  21. <option value="none">Select a Smiley </option>
  22. <option onclick="add_ubbc(' :)');" value="smile">Smile</option>
  23. <option onclick="add_ubbc(' ;)');" value="wink">Wink</option>
  24. <option onclick="add_ubbc(' ;D');" value="grin">Grin</option>
  25. <option onclick="add_ubbc(' 8-)');" value="Cool">Cool</option>
  26. </select>
  27. </form>
  28. </div>
 

Re: drop down smileys code - Posted By Michael (wrighty) on 30th Dec 07 at 8:00pm
Try this:

Code:
 
  1. <div id="dropDown">
  2. <form action="#">
  3. <select name="ubbc">
  4. <option value="none">Select a Smiley </option>
  5. <option onclick="add_ubbc(' :)');" value="smile">Smile</option>
  6. <option onclick="add_ubbc(' ;)');" value="wink">Wink</option>
  7. <option onclick="add_ubbc(' ;D');" value="grin">Grin</option>
  8. <option onclick="add_ubbc(' 8-)');" value="Cool">Cool</option>
  9. </select>
  10. </form>
  11. </div>
  12. <script type="text/javascript">
  13. <!--
  14.  
  15. if(location.href.match(/\/post\//)){
  16. var getRow = document.getElementsByTagName("tr");
  17. for(x=0; x<getRow.length; x++){
  18. if(getRow[x].cells[0].innerHTML.match(/Smilies/i) && getRow[x].cells[0].width == '15%'){
  19. var drop = document.getElementById("dropDown").innerHTML;
  20. getRow[x].cells[1].innerHTML = drop;
  21. }
  22. }
  23. }
  24.  
  25. //-->
  26. </script>
 

Re: drop down smileys code - Posted By Danny (schnooble) on 30th Dec 07 at 8:03pm
now its showing [object HTMLDivElement]

Re: drop down smileys code - Posted By Michael (wrighty) on 30th Dec 07 at 8:03pm
link to your forum?

I have tested it and it works... I'm using FF

Re: drop down smileys code - Posted By Danny (schnooble) on 30th Dec 07 at 8:06pm
ahh its working now thanks man, I hadnt copied it properly before. hanks alot man {Cheesy}

Re: drop down smileys code - Posted By Michael (wrighty) on 30th Dec 07 at 8:07pm
No worries! {Grin}

Re: [F] drop down smileys code - Posted By Danny (schnooble) on 30th Dec 07 at 8:13pm
now when I make a post it says "Invalid Post Form Submitted"

you have any idea why this is man ?

Re: [F] drop down smileys code - Posted By Michael (wrighty) on 30th Dec 07 at 8:15pm
are you clicking submit?

Re: [F] drop down smileys code - Posted By BizzD (0wnzer) on 30th Dec 07 at 8:15pm
Now i know why Wrighty is a coding mod.... {Cool}

Re: [F] drop down smileys code - Posted By Danny (schnooble) on 30th Dec 07 at 8:16pm
 
Now i know why Wrighty is a coding mod.... {Cool}


LMAO !

and yeah I am {Tongue Out}

Re: [F] drop down smileys code - Posted By Michael (wrighty) on 30th Dec 07 at 8:16pm
lolz and why might that be?

I have had a look and I doesn't get why... ;/

Re: [F] drop down smileys code - Posted By Danny (schnooble) on 30th Dec 07 at 8:19pm
{Unsure} ah well il just try figure it out {Tongue Out}

Re: [F] drop down smileys code - Posted By Marc (cr0w) on 30th Dec 07 at 8:23pm
Can we get a link to your forum?

Re: [F] drop down smileys code - Posted By BizzD (0wnzer) on 30th Dec 07 at 8:23pm
Well, you can fix codes and arecode well while me i am most likely the opposite. I can do a few codes that most people know.

Re: [F] drop down smileys code - Posted By Michael (wrighty) on 30th Dec 07 at 8:25pm
 
{Unsure} ah well il just try figure it out {Tongue Out}



gimme 2 mins! {Smile}

Re: [F] drop down smileys code - Posted By Michael (wrighty) on 30th Dec 07 at 8:28pm
Code:
 
  1. <div id="dropDown">
  2. <select name="ubbc">
  3. <option value="none">Select a Smiley </option>
  4. <option onclick="add_ubbc(' :)');" value="smile">Smile</option>
  5. <option onclick="add_ubbc(' ;)');" value="wink">Wink</option>
  6. <option onclick="add_ubbc(' ;D');" value="grin">Grin</option>
  7. <option onclick="add_ubbc(' 8-)');" value="Cool">Cool</option>
  8. </select>
  9. </div>
  10. <script type="text/javascript">
  11. <!--
  12.  
  13. if(location.href.match(/\/post\//)){
  14. var getRow = document.getElementsByTagName("tr");
  15. for(x=0; x<getRow.length; x++){
  16. if(getRow[x].cells[0].innerHTML.match(/Smilies/i) && getRow[x].cells[0].width == '15%'){
  17. var drop = document.getElementById("ubbc")
  18. getRow[x].cells[1].replaceChild(drop, getRow[x].cells[1].firstChild);
  19. }
  20. }
  21. }
  22.  
  23. //-->
  24. </script>
 



{Cheesy}

Re: [F] drop down smileys code - Posted By BizzD (0wnzer) on 30th Dec 07 at 8:31pm
3 mins. to make that? It would take me at least a couple of hours for me! {Shocked}

Re: [F] drop down smileys code - Posted By Michael (wrighty) on 30th Dec 07 at 8:32pm
he made most of it if you didn't notice! {Tongue Out}

I changed 2 maybe 3 lines of it.

Re: [F] drop down smileys code - Posted By Marc (cr0w) on 30th Dec 07 at 8:32pm
 
3 mins. to make that? It would take me at least a couple of hours for me! {Shocked}


He didn't remake it from scratch in three minutes; he just modified the already-finished one. {Wink} {Tongue Out}

Re: [F] drop down smileys code - Posted By Danny (schnooble) on 30th Dec 07 at 8:43pm
THANKS DUDE ! WRIGHTY Smiley {Kiss} {Tongue Out}

Re: [F] drop down smileys code - Posted By Michael (wrighty) on 30th Dec 07 at 8:43pm
Glad it's finally finished!

{Grin}

Re: [F] drop down smileys code - Posted By Danny (schnooble) on 30th Dec 07 at 8:47pm
{Unsure} now the drop down isnt showing up just a little input box

click

Re: [F] drop down smileys code - Posted By Michael (wrighty) on 30th Dec 07 at 8:51pm
change:
<select name="ubbc">

to
<select id="ubbc">

Re: [F] drop down smileys code - Posted By Marc (cr0w) on 30th Dec 07 at 8:52pm
Code:
 
  1. <div id="dropDown">
  2. <select name="ubbc">
  3. <option value="none">Select a Smiley </option>
  4. <option onclick="add_ubbc(' :)');" value="smile">Smile</option>
  5. <option onclick="add_ubbc(' ;)');" value="wink">Wink</option>
  6. <option onclick="add_ubbc(' ;D');" value="grin">Grin</option>
  7. <option onclick="add_ubbc(' 8-)');" value="Cool">Cool</option>
  8. </select>
  9. </div>
  10. <script type="text/javascript">
  11. <!--
  12.  
  13. if(location.href.match(//post//)){
  14. var getRow = document.getElementsByTagName("tr");
  15. for(x=0; x<getRow.length; x++){
  16. if(getRow[x].cells[0].innerHTML.match(/Smilies/i) && getRow[x].cells[0].width == '15%'){
  17. var drop = document.getElementById("dropDown").getElementsByTagName("select")[0];
  18. getRow[x].cells[1].replaceChild(drop, getRow[x].cells[1].firstChild);
  19. }
  20. }
  21. }
  22.  
  23. //-->
  24. </script>
 


Try that. {Smile}

EDIT: Fine Wrighty, post a millisecond before me. >.< {Tongue Out}

Re: [F] drop down smileys code - Posted By Michael (wrighty) on 30th Dec 07 at 8:52pm
or that cr0w! {Tongue Out}

Re: [F] drop down smileys code - Posted By Marc (cr0w) on 30th Dec 07 at 8:53pm
 
or that cr0w! {Tongue Out}


Your way will run quicker; mine has to find the div, then return the dropdown in an array before grabbing the info from it; yours just directly grabs the dropdown. {Wink}

Re: [F] drop down smileys code - Posted By Michael (wrighty) on 30th Dec 07 at 8:54pm
exactly! {Tongue Out} {Grin}

Re: [F] drop down smileys code - Posted By Danny (schnooble) on 30th Dec 07 at 8:55pm
crows code brings back the drop down box but it says "Invalid Post Form Submitted" again.

Re: [F] drop down smileys code - Posted By Michael (wrighty) on 30th Dec 07 at 8:56pm
and my way?

Re: [F] drop down smileys code - Posted By Danny (schnooble) on 30th Dec 07 at 8:57pm
sorry {Tongue Out} your way just kepps it the same as it was.

Re: [F] drop down smileys code - Posted By Michael (wrighty) on 30th Dec 07 at 8:57pm
{Unsure} shouldn't do... browser?

Re: [F] drop down smileys code - Posted By Danny (schnooble) on 30th Dec 07 at 8:58pm
opera

Re: [F] drop down smileys code - Posted By Michael (wrighty) on 30th Dec 07 at 8:59pm
let me test it in that then...

Re: [F] drop down smileys code - Posted By Michael (wrighty) on 30th Dec 07 at 9:02pm
Global header:
Code:
 
  1. <div id="dropDown">
  2. <select id="ubbc">
  3. <option value="none">Select a Smiley </option>
  4. <option onclick="add_ubbc(' :)');" value="smile">Smile</option>
  5. <option onclick="add_ubbc(' ;)');" value="wink">Wink</option>
  6. <option onclick="add_ubbc(' ;D');" value="grin">Grin</option>
  7. <option onclick="add_ubbc(' 8-)');" value="Cool">Cool</option>
  8. </select>
  9. </div>
 


Global Footer
Code:
 
  1. <script type="text/javascript">
  2. <!--
  3. if(location.href.match(/\/post\//)){
  4. var getRow = document.getElementsByTagName("tr");
  5. for(x=0; x<getRow.length; x++){
  6. if(getRow[x].cells[0].innerHTML.match(/Smilies/i) && getRow[x].cells[0].width == '15%'){
  7. var drop = document.getElementById("ubbc")
  8. getRow[x].cells[1].replaceChild(drop, getRow[x].cells[1].firstChild);
  9. }
  10. }
  11. }
  12.  
  13. //-->
  14. </script>
 


That works! {Cheesy}

Re: [F] drop down smileys code - Posted By Danny (schnooble) on 30th Dec 07 at 9:03pm
THANKS MAN {Cheesy} you are a legend

Re: [F] drop down smileys code - Posted By Michael (wrighty) on 30th Dec 07 at 9:04pm
About time it worked! {Tongue Out}

Sorry, I didn't test in Opera

Re: [F] drop down smileys code - Posted By Marc (cr0w) on 30th Dec 07 at 9:21pm
Does an error come with the "Invalid Message", or is that all it says?

Re: drop down smileys code - Posted By Danny (schnooble) on 30th Dec 07 at 9:30pm
it did but not anymore {Smile}

Re: drop down smileys code - Posted By Marc (cr0w) on 30th Dec 07 at 9:35pm
 
it did but not anymore {Smile}


My bad, didn't see the third page [again]. >.<

Re: drop down smileys code - Posted By Michael (wrighty) on 30th Dec 07 at 9:35pm
can I has my [f] Back? {Tongue Out}