Ask a Question related to Macromedia Dynamic HTML, Design and Development.
-
Mattastic #1
Calling Javascript Functions
Hi,
I've done a function to populate a drop down list, but I cant seem to call it
properly.
==================
This is in the head of the document:
<script language="JavaScript">
function addAge(){
var optionNum = 0+2;
for (var i = 1; i <= 100; i++) {
document.personalDetails.day.options[optionNum] = new Option(i, i);
optionNum++;
}
}
</script>
================================
I then call the function on the form page like this:
<script language="JavaScript">
addAge( );
</script>
Hope you can help.
Mattastic Guest
-
Calling other functions
All, Using .NET 1.1, I have built a custom control, however I am having trouble compiling it. For the on click event of the button, I want it to... -
calling javascript dom functions from a flash objectwith frames
Calling dom javascript functions from a flash object works properly in a regular web page. When this page is a part of a frameset on another... -
Calling functions between frames...
JavaScript can not run on server side. You can include it in the output of your PHP script. "Albert Finchly" <Albert_Finchly@Yahoo.co.uk>... -
Calling functions?
Hello, I wrote a jscript function within the HTML window of my webpage and would like to call it from inside the ASPX code-behind page. Any... -
calling functions
how do i call a vbscript function (which is between <%%>) from a vbscript script function (which is between script tags-<script... -
João Cândido de Souza Neto #2
Re: Calling Javascript Functions
Please, send your completly code ?
--
________________________________________
João Cândido de Souza Neto
Consultor Web
Idealizador e Instrutor do curso de Web Developer na Microlins Varginha
A inteligência não substitui a falta de informação.
"Mattastic" <webforumsuser@macromedia.com> wrote in message
news:ch7a77$97u$1@forums.macromedia.com...call it> Hi,
>
> I've done a function to populate a drop down list, but I cant seem to> properly.
>
> ==================
> This is in the head of the document:
> <script language="JavaScript">
> function addAge(){
> var optionNum = 0+2;
> for (var i = 1; i <= 100; i++) {
> document.personalDetails.day.options[optionNum] = new Option(i, i);
> optionNum++;
> }
> }
> </script>
> ================================
> I then call the function on the form page like this:
> <script language="JavaScript">
> addAge( );
> </script>
>
> Hope you can help.
>
>
>
João Cândido de Souza Neto Guest
-
Mattastic #3
Re: Calling Javascript Functions
Ok Thanks, here is the code
====
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
font-family: Verdana, Arial, Helvetica, sans-serif;
}
textarea, input {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 84%;
}
td {
vertical-align: top;
font-size: 84%;
}
table {
border: none;
margin: 3px;
padding: 3px;
}
-->
</style>
<script language="JavaScript">
function addAge(){
var optionNum = 2;
//adds age
for (var i = 1; i <= 100; i++) {
document.personalDetails.day.options[optionNum] = new Option(i, i);
optionNum++;
}
}
</script>
</head>
<body >
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
Please complete this form clearly and accurately,
click next when each section is complete.1
<script language="JavaScript">
addAge( );
</script>
<form name="personalDetails" method="post" action="">
<table width="760" border="0" align="center" cellpadding="5" cellspacing="0">
<tr>
<td width="50%" valign="top"><strong>Personnel Details</strong><br>
<br>
<table border=0 align="center" cellpadding=3 cellspacing=0>
<tr>
<td> </td>
<td class=bldturq11 valign=bottom>surname</td>
</tr>
<tr>
<td> </td>
<td><input name="sName" type="text" value="" class=input1col
maxlength=40></td>
</tr>
<tr>
<td> </td>
<td class=bldturq11 valign=bottom>first name</td>
</tr>
<tr>
<td> </td>
<td><input name="fName" type="text" value="" class=input1col
maxlength=40></td>
</tr>
<tr>
<td> </td>
<td class=bldturq11 valign=bottom>date of birth - dd mm yyyy</td>
</tr>
<tr>
<td> </td>
<td><table width=144 cellspacing=0 cellpadding=0 border=0>
<tr>
<td width="38" class=inputdate1><select name="day">
</select></td>
<td width="38" class=inputdate1><input name="dobMM"
type="text" value="" size=3 class=inputdate1 maxlength=2></td>
<td width="68" class=inputdate2><input name="dobYYYY"
type="text" value="" size=5 class=inputdate2 maxlength=4></td>
</tr>
</table></td>
</tr>
</table>
</td>
<td width="50%">
<table border=0 align="center" cellpadding=3 cellspacing=0>
<tr>
<td height="20" > </td>
<td width="200" valign=bottom class=bldturq11>Address</td>
</tr>
<tr>
<td> </td>
<td><input name="email" type="text" value="" class=input1col
maxlength=40></td>
</tr>
<tr>
<td height="31"> </td>
<td><input name="houseName" type="text" value="" class=input1col
maxlength=40></td>
</tr>
<tr>
<td class=sp22> </td>
<td class=bldturq11 valign=bottom>Town</td>
</tr>
<tr>
<td> </td>
<td><input name="postCode" type="text" value="" class=input1col
maxlength=8></td>
</tr>
<tr>
<td> </td>
<td colspan=3 class=bldturq11 valign=bottom>Post Code</td>
</tr>
<tr>
<td> </td>
<td class=input1col><input name="registration" type="text" size=24
class=input1col value="" maxlength=10 ></td>
</tr>
<tr>
<td class=sp22> </td>
<td td colspan=3 class=bldturq11 valign=bottom>Phone - home</td>
</tr>
<tr>
<td> </td>
<td class=select1col> <input name="registration2" type="text"
size=24 class=input1col value="" maxlength=10 >
</td>
</tr> <tr>
<td> </td>
<td class=select1col> Mobile</td>
</tr> <tr>
<td> </td>
<td class=select1col> <input name="registration22" type="text"
size=24 class=input1col value="" maxlength=10
onchange="document.theForm.action.value=''"></td>
</tr><tr>
<td> </td>
<td class=select1col> Email</td>
</tr><tr>
<td> </td>
<td class=select1col> <input name="registration22" type="text"
size=24 class=input1col value="" maxlength=10
onchange="document.theForm.action.value=''"></td>
</tr>
</table>
</td>
</tr>
</table></form>
</td>
</tr>
</table>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="20"></td>
<td><div align="right">
<a href="index.cfm?page=next&count=1"><img src="images/next.gif"
border="0"></a>
</div></td>
</tr>
</table>
</body>
</html>
===========================
Mattastic Guest
-
João Cândido de Souza Neto #4
Re: Calling Javascript Functions
Call the addage function after the definition day select.
--
________________________________________
João Cândido de Souza Neto
Consultor Web
Idealizador e Instrutor do curso de Web Developer na Microlins Varginha
A inteligência não substitui a falta de informação.
"Mattastic" <webforumsuser@macromedia.com> wrote in message
news:ch7c3a$bt1$1@forums.macromedia.com...cellspacing="0">> Ok Thanks, here is the code
>
> ====
> <html>
> <head>
> <title>Untitled Document</title>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> <style type="text/css">
> <!--
> body {
> font-family: Verdana, Arial, Helvetica, sans-serif;
> }
> textarea, input {
> font-family: Verdana, Arial, Helvetica, sans-serif;
> font-size: 84%;
> }
> td {
> vertical-align: top;
> font-size: 84%;
> }
> table {
> border: none;
> margin: 3px;
> padding: 3px;
> }
>
> -->
> </style>
>
> <script language="JavaScript">
> function addAge(){
> var optionNum = 2;
> //adds age
> for (var i = 1; i <= 100; i++) {
> document.personalDetails.day.options[optionNum] = new Option(i, i);
> optionNum++;
> }
> }
>
> </script>
> </head>
> <body >
>
>
> <table width="760" border="0" align="center" cellpadding="0"cellspacing="0">> <tr>
> <td>
>
>
>
> Please complete this form clearly and accurately,
> click next when each section is complete.1
>
> <script language="JavaScript">
> addAge( );
> </script>
>
>
> <form name="personalDetails" method="post" action="">
>
> <table width="760" border="0" align="center" cellpadding="5"yyyy</td>> <tr>
> <td width="50%" valign="top"><strong>Personnel Details</strong><br>
> <br>
> <table border=0 align="center" cellpadding=3 cellspacing=0>
> <tr>
> <td> </td>
> <td class=bldturq11 valign=bottom>surname</td>
> </tr>
> <tr>
> <td> </td>
> <td><input name="sName" type="text" value="" class=input1col
> maxlength=40></td>
> </tr>
> <tr>
> <td> </td>
> <td class=bldturq11 valign=bottom>first name</td>
> </tr>
> <tr>
> <td> </td>
> <td><input name="fName" type="text" value="" class=input1col
> maxlength=40></td>
> </tr>
> <tr>
> <td> </td>
> <td class=bldturq11 valign=bottom>date of birth - dd mmclass=input1col> </tr>
> <tr>
> <td> </td>
> <td><table width=144 cellspacing=0 cellpadding=0 border=0>
> <tr>
> <td width="38" class=inputdate1><select name="day">
>
> </select></td>
> <td width="38" class=inputdate1><input name="dobMM"
> type="text" value="" size=3 class=inputdate1 maxlength=2></td>
> <td width="68" class=inputdate2><input name="dobYYYY"
> type="text" value="" size=5 class=inputdate2 maxlength=4></td>
> </tr>
> </table></td>
> </tr>
> </table>
> </td>
> <td width="50%">
> <table border=0 align="center" cellpadding=3 cellspacing=0>
> <tr>
> <td height="20" > </td>
> <td width="200" valign=bottom class=bldturq11>Address</td>
> </tr>
> <tr>
> <td> </td>
> <td><input name="email" type="text" value="" class=input1col
> maxlength=40></td>
> </tr>
> <tr>
> <td height="31"> </td>
> <td><input name="houseName" type="text" value=""size=24> maxlength=40></td>
> </tr>
> <tr>
> <td class=sp22> </td>
> <td class=bldturq11 valign=bottom>Town</td>
> </tr>
> <tr>
> <td> </td>
> <td><input name="postCode" type="text" value="" class=input1col
> maxlength=8></td>
> </tr>
> <tr>
> <td> </td>
> <td colspan=3 class=bldturq11 valign=bottom>Post Code</td>
> </tr>
> <tr>
> <td> </td>
> <td class=input1col><input name="registration" type="text"home</td>> class=input1col value="" maxlength=10 ></td>
> </tr>
> <tr>
> <td class=sp22> </td>
> <td td colspan=3 class=bldturq11 valign=bottom>Phone -cellspacing="0">> </tr>
> <tr>
> <td> </td>
> <td class=select1col> <input name="registration2" type="text"
> size=24 class=input1col value="" maxlength=10 >
> </td>
> </tr> <tr>
> <td> </td>
> <td class=select1col> Mobile</td>
> </tr> <tr>
> <td> </td>
> <td class=select1col> <input name="registration22" type="text"
> size=24 class=input1col value="" maxlength=10
> onchange="document.theForm.action.value=''"></td>
> </tr><tr>
> <td> </td>
> <td class=select1col> Email</td>
> </tr><tr>
> <td> </td>
> <td class=select1col> <input name="registration22" type="text"
> size=24 class=input1col value="" maxlength=10
> onchange="document.theForm.action.value=''"></td>
> </tr>
> </table>
> </td>
> </tr>
> </table></form>
> </td>
> </tr>
> </table>
> <table width="760" border="0" align="center" cellpadding="0"src="images/next.gif"> <tr>
> <td height="20"></td>
> <td><div align="right">
> <a href="index.cfm?page=next&count=1"><img> border="0"></a>
> </div></td>
> </tr>
> </table>
> </body>
> </html>
> ===========================
>
João Cândido de Souza Neto Guest
-



Reply With Quote

