Solved

Text box not displaying text

Posted on 2011-03-04
14
422 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
 

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This article discusses four methods for overlaying images in a container on a web page
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

910 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now