Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Trying to add a link to 'alert_text'
Old 10-02-2009, 12:20 AM Trying to add a link to 'alert_text'
Extreme Talker

Posts: 216
Trades: 0
I'm using this script which restricts uploading until a fee is paid.
When the user selects the upload button the 'alert-text' from this script(below) pops-up with a message. That's works successfully.

However, I tried to add a link to the message, and when I retried it, the message and the requirement was skipped altogether. When I removed the link from the message, all was well again, the message popped-up as before.

Why, in the this line of code below:

Code:
document.getElementById('alert_text').innerHTML =
can't I add a link to that line and still have it perform successfully? Any ideas? Thanks.

Code:
<script>
          //
          function takeAction()
          {
            if (document.getElementById('upload_permission').innerHTML == "Y")
            {
              window.location.href = "/upload.php";
            }
            else
            {
              alert(document.getElementById('alert_text').innerHTML);
              return false;
            }
          }
          //
          var member_credits = document.getElementById('member_credits').innerHTML;
          var upload_permission = document.getElementById('upload_permission').innerHTML;
          //
          if (upload_permission == "")
          {
            document.getElementById('upload_credit').innerHTML = "";
            document.getElementById('upload_restrictions').innerHTML = "You cannot upload videos without first logging in.<br>";
            document.getElementById('login_request').innerHTML = "If you have not already logged in, please do that first.";
            document.getElementById('alert_text').innerHTML = "Please log in before attempting an upload.";
          }
          else if (upload_permission == "Y")
          {
            document.getElementById('upload_credit').innerHTML = "Your upload credit is on file.<br>";
            document.getElementById('upload_restrictions').innerHTML = "You may use this webpage to upload videos.";
            document.getElementById('login_request').innerHTML = "";
            document.getElementById('alert_text').innerHTML = "";
          }
          else
          {
            if (upload_permission.length > 1)  // referrer send back more than just a flag!  -JG
            {
              document.getElementById('upload_credit').innerHTML = "*** " + upload_permission + " ***";
              document.getElementById('upload_restrictions').innerHTML = "";
              document.getElementById('login_request').innerHTML = "";
              document.getElementById('alert_text').innerHTML = upload_permission + "\r\nPlease contact the webmaster for assistance.";
            }
            else
            {
              document.getElementById('upload_credit').innerHTML = "No update credits on file.<br>";
              document.getElementById('upload_restrictions').innerHTML = "You need to <a href='uploadfee.php' style='text-decoration:underline;'>purchase 1 upload credit</a> to upload videos.<br>";
              document.getElementById('login_request').innerHTML = "";
              document.getElementById('alert_text').innerHTML = "Please click on the 'purchase 1 upload credit' link to pay upload fee.";
            }
          }
        </script>
        <!-- ==========================================================
chrisj is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to Trying to add a link to 'alert_text'
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.08373 seconds with 12 queries