The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> HTML - JavaScript query, Online LaTeX simulator
balkics
post Nov 7 2014, 04:21 AM
Post #1


Newbie
*

Group: Members
Posts: 19
Joined: 5-November 14
Member No.: 21,773



http://www.hostmath.com/Default.aspx

I am trying to create something like this. But I am struggling how to link the fields.
I need to link the buttons with the fields /when the button is pressed to show the code in the top menu and the formula on the bottom menu/.
Could you advice me how to link the code field/first field/ and the formula field/bottom field/.
I see there are JavaScript and ajax.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Nov 8 2014, 12:20 AM
Post #2


Programming Fanatic
********

Group: Members
Posts: 1,981
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



What have you tried? Where is your code or URL to your page? If you need help then show us what you are doing.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
balkics
post Nov 10 2014, 06:45 AM
Post #3


Newbie
*

Group: Members
Posts: 19
Joined: 5-November 14
Member No.: 21,773



QUOTE(CharlesEF @ Nov 8 2014, 09:20 AM) *

What have you tried? Where is your code or URL to your page? If you need help then show us what you are doing.

Till now I have created 2 forms which are connected - typing into the first it will appear into the second form - like mirror typing and I also added a button which type text in the first textarea and it should appear into the second textarea but it only appears if I manually type something into the FirstTextArea /consequence1/ because when I click the button it populates the text into the consequence1 are but it will only appear into the second "whatWasDone" area if I type some text:

<textarea id="consequence1" cols="60" rows="5">
</textarea><br>

<textarea id="whatWasDone" cols="60" rows="5">
</textarea><br>

<script>
$("#consequence1").bind("keyup paste", function()
{ $("#whatWasDone").val($(this).val()); }

);
</script>

<script>
function printChar(char)
{ var printBox = document.getElementById('consequence1'); printBox.value = printBox.value + char; }

</script>
<input type="button" value=" Lgab " onClick="java script:printChar(this.value);" />
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Nov 10 2014, 08:58 AM
Post #4


.
********

Group: WDG Moderators
Posts: 9,653
Joined: 10-August 06
Member No.: 7



If you want to add the same button's value to both textareas you might use:

CODE
function printChar(char)
{
    document.getElementById('consequence1').value += char;
    document.getElementById('whatWasDone').value += char;
}
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Nov 10 2014, 10:00 AM
Post #5


.
********

Group: WDG Moderators
Posts: 9,653
Joined: 10-August 06
Member No.: 7



Or if you want to copy the first textarea's value to the second, you might use

CODE
function printChar(char)
{
    document.getElementById('consequence1').value += char;
    document.getElementById('whatWasDone').value = document.getElementById('consequence1').value;
}
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
balkics
post Nov 10 2014, 11:35 AM
Post #6


Newbie
*

Group: Members
Posts: 19
Joined: 5-November 14
Member No.: 21,773



QUOTE(Christian J @ Nov 10 2014, 07:00 PM) *

Or if you want to copy the first textarea's value to the second, you might use

CODE
function printChar(char)
{
    document.getElementById('consequence1').value += char;
    document.getElementById('whatWasDone').value = document.getElementById('consequence1').value;
}


This is realy helpful - thank you!
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th April 2024 - 07:20 PM