Web Wiz - Solar Powered Eco Web Hosting

  New Posts New Posts RSS Feed - Using javascript to access form value
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Using javascript to access form value

 Post Reply Post Reply
Author
adamwsh View Drop Down
Newbie
Newbie


Joined: 28 December 2007
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote adamwsh Quote  Post ReplyReply Direct Link To This Post Topic: Using javascript to access form value
    Posted: 11 October 2011 at 3:27pm
Below is my code to use the WebWizRTE control on my page.
I want to be access the contents of the control via Javascript.  When I do this, all I see is the contents of my original html textbox, not what is in the WebWiz control.

How can I use javascript to access the contents of the WebWiz control? 
How can I make sure I'm getting the user entered content in either the HTML control (if the WebWiz control didn't load for them) or the WebWiz control (if it did load for them)?



<%
'Declare the ASP variables used
Dim strFormName
Dim strTextAreaName

'ID tag name of the HTML form the textarea is within
strFormName = "frmMessage"

'ID tag name of HTML textarea being replaced
strTextAreaName = "txtMessage"
%> 
<!--#include file="RTE_editor_inc.asp" -->
<form id="frmMessage" name="frmMessage" language="JavaScript" >
<textarea rows="10" name="txtMessage" id="txtMessage" cols="100">this is not working yet. Don't type anything here.</textarea>
</form>
<input type="button" id="btnSendReply" name="btnSendReply" value="Send Reply" onclick="PostReply()">


function PostReply()
{
alert(document.getElementById("txtMessage").value);
}

Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9791
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 11 October 2011 at 3:37pm
Your text area is replaced with an editable IFrame. To get the contents of the IFrame you need to use:-

document.getElementById('WebWizRTE').contentWindow.document.body.innerHTML
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.07
Copyright ©2001-2024 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Policy

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2024 Web Wiz Ltd. All rights reserved.