View Single Post
Old 05-12-2011, 10:02 AM   PM User | #1
helloise
New Coder

 
Join Date: Jan 2011
Posts: 79
Thanks: 7
Thanked 0 Times in 0 Posts
helloise has a little shameless behaviour in the past
return a value in javascript help needed

i have this line of code:
Code:
    <a href="#" id="profilelink" name="link2" onClick="viewornot(<?php echo $freechat_id ?>)"><?php echo $freechat_list; ?></a>
    //call the JS onclick and if OK was click do the message box and send button here
then i have my JS:
Code:
    function viewornot(id)
    {
       var e = confirm('Do you want to view this profile?');
       if (e == true)
       {
           window.location.href = "http://www-rainbowcode-net/apps_dev.php/profiles/showprofilepersonal?id="+id;
           window.location('http://www-rainbowcode-net/apps_dev.php/profiles/showprofilepersonal?id='+id);
           return true;
       }
       else
       {
          var e2 = confirm('Do you want to send a message?');
          if (e2 == true)
          {
              //if ok was clicked send value back?? 
              return e2;
          } 
       }  
     }
on the e2 confirm: if i clicked OK how can i send a value back(so that i know OK was clicked) so that i can then produce the message box and send button and do the rest of the code to send a message???

thank you
helloise is offline