Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Aug 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    printing Textarea problems

    Heya All,

    Im a professional PHP Developer for a company called Villaway, but that is irrelevant, i posted that so you know I have programming knowledge and from what I can see, JavaScript is very similar to PHP and ActionScript, im a noob when it comes to JavaScript but not when it comes to PHP.

    I am making my own Dreamweaver Extension (I know maybe i should seek help from an extension developing forum), all it does it insert some text (in the format of comment codes) into the top of any page you save, its actually a simple Version Control System.

    I have made my menu etc, it contains a Textarea, i had it working once but deleted it! Here is what Ive got (by the way, i am using another extension and just editing it for now whilst im still learning hence the uppercase tags!):

    File: trystVC.htm
    Code:
    <!DOCTYPE HTML SYSTEM "-//Macromedia//DWExtension layout-engine 5.0//dialog">
    
    <HTML>
    <HEAD>
    <Title>Trystans Version Control</Title>
    <SCRIPT SRC="trystVC.js"></SCRIPT>
    
    </HEAD>
    <BODY>
     <form name="uorl">
     	<table border="0">
        <tr> 
          <td valign="top" nowrap>
    	  <textarea name="content" cols="80" rows="10"></textarea></td>
        		</tr>
      		</table>
      	</div>
     </form>
    </BODY>
    </HTML>
    File: trystVC.js
    Code:
    // JavaScript Document
    
    function commandButtons() {
    	return new Array("OK", "changeCase()", "Cancel", "window.close()");
    }
    
    function changeCase() {
      var uorl;
      if(document.forms['uorl'].elements[0])
      {
    		alert(document.forms['uorl'].elements[0]);
      }
      else
      {
    	  alert("NO");
      }
      window.close();	// close extension UI
    }
    Now my problem is for one I cannot return if the textarea is empty, and second i cant return what is actually entered into the textarea...

    I understand the syntax of JavaScript as it is almost identical to PHP but i do not know many JavaScript functions! I wish there was a JavaScript manual like their is a PHP one on php.net!

    All help is appreciated, im starting off simple and build it up! That way I will understand it better!

    Thanks again.

  • #2
    Regular Coder
    Join Date
    Jun 2006
    Posts
    225
    Thanks
    6
    Thanked 3 Times in 3 Posts

  • #3
    New to the CF scene
    Join Date
    Aug 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks a lot DownStrike,

    after browsing the JavaScript forums on here, i was looking at other peoples codes and fixed it myself here is my revised code:

    Code:
    // JavaScript Document
    
    function commandButtons() {
    	return new Array("OK", "changeCase()", "Cancel", "window.close()");
    }
    
    function changeCase() {
      var uorl;
      if(document.forms['uorl'].elements[0])
      {
    		alert(document.forms['uorl'].content.value);
      }
      else
      {
    	  alert("NO");
      }
      window.close();	// close extension UI
    }


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •