Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Text box not displaying text

Posted on 2011-03-04
14
Medium Priority
?
442 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 400 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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 1000 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 600 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

This article discusses how to create an extensible mechanism for linked drop downs.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
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 …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses

927 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