Solved

Text box not displaying text

Posted on 2011-03-04
14
424 Views
Last Modified: 2012-05-11
Hi!

On the below listed page there is a text box, it was displaying the link details but no longer does it. http://www.topsecurityinc.com/link-request-form.asp

Below are the lines of code that are supposed to make it work:

<body onload="breakout_of_frame();updateTextArea()">

function updateTextArea()
{
   document.getElementById("linkCode").value = '<a href="http://www.topsecurityinc.com/" title="Orlando ....">Orlando ...</a>';
// document.getElementById("linkCode").innerHTML = "your desciption";
}

<div style="text-align: center">
   <textarea cols="60" rows="7" name="Link Code" id="linkCode"></textarea>
</div>

Any specific code modifications would be appreciated.
0
Comment
Question by:TrueBlue
  • 8
  • 3
  • 2
  • +1
14 Comments
 
LVL 29

Expert Comment

by:Badotz
ID: 35038383
You might try removing the inline JavaScript from the body tag and adding this:

<script type="text/javascript">

function page_load() {
    breakout_of_frame();
    updateTextArea();
}

window.onload = page_load; // No parens here

</script>
0
 
LVL 11

Assisted Solution

by:mvan01
mvan01 earned 100 total points
ID: 35038462
Here's a work around.  
Change <body onload="..."> to just plain old <body>

Place this line before your </body> line:
<script type="text/javascript">breakout_of_frame();updateTextArea();</script>

Check out the suggestions here:
http://onlinetools.org/articles/unobtrusivejavascript/chapter4.html
0
 
LVL 29

Expert Comment

by:Badotz
ID: 35038519
Good guess, mvan01.
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

Author Comment

by:TrueBlue
ID: 35038962
I assume both of these suggestions would go inside the head tags.
I tried each and unfortunately neither displayed anything in the text box.
Is the syntax perhaps wrong in the javascript?
Any other ideas?
TIA
0
 
LVL 29

Expert Comment

by:Badotz
ID: 35038997
>>I assume both of these suggestions would go inside the head tags.

That is true for my suggestion.

>>Any other ideas?

Comment the breakout_of_frame(); line and see if it wirks.
0
 
LVL 29

Expert Comment

by:Badotz
ID: 35039005
Or change the function as follows:

function page_load() {
    debugger; // This will invoke the debugger
    breakout_of_frame();
0
 

Author Comment

by:TrueBlue
ID: 35043397
Badotz,

I tried removing the breakout_of_frame() and the debugger suggestion and received no change nor error. I think the problem is with the syntax of the URL, title, etc after the value statement. It all shows as the same color in Office Sharepoint Designer. I think the ahref, title and <a> should be a different color. Like I need a combination of single and double quotes.
Any ideas?
TIA
0
 
LVL 16

Expert Comment

by:sjklein42
ID: 35043781
If you'd like to post more of the code, we may be able to find the problem.  For example, please include the breakout_of_frame code also. The more, the better.

The symptom of not even going into the debugger seems like the breakout_of_frame function has an error and it is not even getting to the updateTextArea function.
0
 
LVL 29

Expert Comment

by:Badotz
ID: 35043862
>>If you'd like to post more of the code

The Web Developer (Firefox addon) "View Source" will drill-down into all of the included files, if you're interested.
0
 

Author Comment

by:TrueBlue
ID: 35043892
sjklein42,

Here is the code for the breakout_of_frame function.

function breakout_of_frame()
{
 if (top.location != location) {
    top.location.href = document.location.href ;
  }
}
0
 
LVL 29

Expert Comment

by:Badotz
ID: 35043910
What browser/version are you using?
0
 
LVL 16

Accepted Solution

by:
sjklein42 earned 250 total points
ID: 35043964
This line, way down in your page, is replaceing the body onload callback with its own, so yours isn't getting called:

<script type="text/javascript" src="http://www.link-assistant.com/submit/validation.js"></script>

Open in new window

0
 
LVL 29

Assisted Solution

by:Badotz
Badotz earned 150 total points
ID: 35043978
sjklein42: Well, nice catch.
0
 
LVL 29

Expert Comment

by:Badotz
ID: 35044396
No worries - glad to help.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question