Click to See Complete Forum and Search --> : Adding Mathmatical Symbol and Greek letters.


richard76
09-03-2003, 02:32 AM
Hello all,

I am Richard and new to web development. I am creating a quiz in web for marhematics subjects. I have a form to enter the questions and answer from the Teacher's side. I would like to add Mathematical symbols and Greek letters to the Text fields(Input boxes). For that I would like to store the Mathematical symbols and Greek letters in a different page with links in the symbols. I will give the link near the text box. While cliking the form the new HTML page should open in the pop up, and when the Teacher click the symbol it should be added in the text boxes. Suppose if there is any text there in the text box, then the symbols should be placed continuosly..What can I do.Please advise me.

Fang
09-03-2003, 03:03 AM
Is this something like what you require:

<form name="maths">
<input type="text" name="user" />
<select name="symbol" onchange="document.maths.user.focus();document.maths.user.value+=this.options[this.selectedIndex].value;">
<option value="">Select maths</option>
<option value="&radic;">&radic; sq.root</option>
<option value="&ang;">&ang; angle</option>
<option value="&int;">&int; intergral</option>
</select>
<select name="greek" onchange="document.maths.user.focus();document.maths.user.value+=this.options[this.selectedIndex].value;">
<option value="">Select greek</option>
<option value="&Alpha;">&Alpha; Alpha</option>
<option value="&Beta;">&Beta; Beta</option>
<option value="&Gamma;">&Gamma; Gamma</option>
</select>
</form>

richard76
09-03-2003, 04:28 AM
Dear Fang,

Thanx for the idea. But I dont want to select it from the menu. I just want to store the symbols into a HTMl page with links below the symbols. when the user click the symbol, the symol's equalant tags should be placed continuous to the next of the text in the text box. And I want to store the symbol's tags in the database also. Please give me some idea.

Thanx.

Fang
09-03-2003, 05:54 AM
You have 2 windows:
window 1 contains the users text box.
window 2 contains a clickable list of symbols, which when clicked are sent to the users text box.
Is it the contents of the text box or just a list of all the symbols that are sent to the database?
Is this the idea?

richard76
09-03-2003, 09:25 AM
Dear Fang,

I just want to send the valued which are in the text box. But normal text no problem. But how can I store the sybbols in the Database. I am using MySQL and PHP.

And How can I create a create the window with list clickable symbols and how can I append the symbols into the text box when I click it. Because the user may not know equivalent tags of the symbols..Give me some idea to solve this problem.

Thanx.

Fang
09-03-2003, 10:59 AM
window 1 opens window 2, click on a symbol to add it to the users window.
The database question can be answered in the PHP forum.

window 1 - user

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>symbols user</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />

<script type="text/javascript">
//<![CDATA[
<!--
window.open('symbols.html', 'symbols', 'toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=no,top=0,left=0,width=200,height=400')
//-->
//]]>
</script>

</head>
<body>
<form name="maths">
<input type="text" name="user" />
</form>
</body>
</html>

window 2 - symbols

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>symbols</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />

<script type="text/javascript">
//<![CDATA[
<!--
function CopySymbol(ch) {
opener.document.maths.user.focus();
opener.document.maths.user.value+=ch;
}
//-->
//]]>
</script>

</head>
<body>
<a href="javascript:CopySymbol('&radic;');">&radic; sq. root</a><br />
<a href="javascript:CopySymbol('&ang;');">&ang; angle</a><br />
<a href="javascript:CopySymbol('&int;');">&int; intergral</a><br />
etc..<br />
For complete list of <a href="<a href="javascript:CopySymbol('&radic;');">&radic; sq. root</a>">symblos</a>

</body>
</html>