Solved

Text box not displaying text

Posted on 2011-03-04
14
421 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
Comment Utility
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
Comment Utility
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
Comment Utility
Good guess, mvan01.
0
 

Author Comment

by:TrueBlue
Comment Utility
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
Comment Utility
>>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
Comment Utility
Or change the function as follows:

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

Author Comment

by:TrueBlue
Comment Utility
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 16

Expert Comment

by:sjklein42
Comment Utility
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
Comment Utility
>>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
Comment Utility
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
Comment Utility
What browser/version are you using?
0
 
LVL 16

Accepted Solution

by:
sjklein42 earned 250 total points
Comment Utility
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
Comment Utility
sjklein42: Well, nice catch.
0
 
LVL 29

Expert Comment

by:Badotz
Comment Utility
No worries - glad to help.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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.…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

772 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

9 Experts available now in Live!

Get 1:1 Help Now