Solved

Text box not displaying text

Posted on 2011-03-04
14
425 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
Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

 

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
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 …

821 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