JavaScript problems
codingmasters
12 Apr 2004, 05:55I'm having problems with the most simplest of Scripts you could write in JavaScript
Everytime I load the following page in IE6, it brings up the error:
Thanks for any help
Matthew G.
Everytime I load the following page in IE6, it brings up the error:
A runtime error has occured
Do you wish to debug?
Line: 7
Error: 'return' statement outside of function
<html>
<head>
<title>Contact Us - CodingMasters</title>
<script language="javascript">
<!--function checkform(){
{if (document.formmail.body.value ="") or (document.formmail.changes.value ="")
alert("You did not fill in the comments box!")
return false}
else return true;
}
//-->
</script>
</head>
<body>
<P align="center"><FONT size="7" color="brown">CodingMasters</FONT></P>
<P align="center">"We give you what <EM>you</EM> want!"</P>
<BR>
<BR>
<center>
Here you can contact us using this form<BR>
<BR>
If <FONT color="#ff0000">*</FONT> is next to a field, it is compulsary<BR>
<form name="formmail" action="/cgi-bin/formmail/formmail.cgi" method="post" onsubmit="return checkForm()">
<input type="hidden" name="recipient" value="codingmasters@yahoo.com.au" style="WIDTH: 185px; HEIGHT: 22px" size="23">
<p><b>Your Name:</b> <input name="realname" size="45"></p>
<br>
<p><b>Your Email Address:</b> <input name="email" size="45"></p>
<br>
<p><b>Comments or Suggestions:</b><br>
<TEXTAREA name="body" rows="8" wrap="virtual" cols="60"></TEXTAREA><FONT color="#ff0000">*</FONT></p>
<br>
<p><b>What would you change about the site:</b><br>
<TEXTAREA name="changes" rows="8" wrap="virtual" cols="60"></TEXTAREA><FONT color="#ff0000">*</FONT></p>
<br>
<p><b>Would you reccomend this site to your friends:</b><br>
<input type="radio" name="friends" value="Yes" checked><input type="radio" name="friends" value="No">
<FONT color="#ff0000">*</FONT>
<p><input type="submit" value="Send Email"> <input type="reset" value="Reset Form"></p>
</form>
<br>
<br>
E-Mail us @ <A HREF="mailto:codingmastershelp@yahoo.com.au">codingmastershelp@yahoo.com.au</A><BR>
<BR>
<A HREF="maillist.htm">Back</A>:<A HREF="index.html">Home</A><br>
This site is hosted by <A HREF="http://www.aurorahost.net">AuroraHost</A>
</center>
</body>
</html>
Thanks for any help
Matthew G.
codingmasters
13 Apr 2004, 23:57Alright, I've been to vbforums.com, and after much tinkering with the file, i've come up with this:
I'm still getting this error, over and over:
[quote]Line: 6
Error: Syntax Error
<html>
<head>
<title>Contact Us - CodingMasters</title>
<script language="javascript">
<!--function
formcheck;
if (document.formmail.body.value =="") || (document.formmail.changes.value =="");
{alert("You did not fill in the comments or changes box!");
return false};
else;
{return true};
//-->
</script>
</head>
<body>
<P align="center"><FONT size="7" color="brown">CodingMasters</FONT></P>
<P align="center">"We give you what <EM>you</EM> want!"</P>
<BR>
<BR>
<center>
Here you can contact us using this form<BR>
<BR>
If <FONT color="#ff0000">*</FONT> is next to a field, it is compulsary<BR>
<form name="formmail" action="/cgi-bin/formmail/formmail.cgi" method="post" onSubmit=return "formcheck">
<input type="hidden" name="recipient" value="codingmasters@yahoo.com.au" style="WIDTH: 185px; HEIGHT: 22px" size="23">
<p><b>Your Name:</b> <input name="realname" size="45"></p>
<br>
<p><b>Your Email Address:</b> <input name="email" size="45"></p>
<br>
<p><b>Comments or Suggestions:</b><br>
<TEXTAREA name="body" rows="8" wrap="virtual" cols="60"></TEXTAREA><FONT color="#ff0000">*</FONT></p>
<br>
<p><b>What would you change about the site:</b><br>
<TEXTAREA name="changes" rows="8" wrap="virtual" cols="60"></TEXTAREA><FONT color="#ff0000">*</FONT></p>
<br>
<p><b>Would you reccomend this site to your friends:</b><br>
<input type="radio" name="friends" value="Yes" checked><input type="radio" name="friends" value="No">
<FONT color="#ff0000">*</FONT>
<p><input type="submit" value="Send Email"> <input type="reset" value="Reset Form"></p>
</form>
<br>
<br>
E-Mail us @ <A HREF="mailto:codingmastershelp@yahoo.com.au">codingmastershelp@yahoo.com.au</A><BR>
<BR>
<A HREF="maillist.htm">Back</A>:<A HREF="index.html">Home</A><br>
This site is hosted by <A HREF="http://www.aurorahost.net">AuroraHost</A>
</center>
</body>
</html>
I'm still getting this error, over and over:
[quote]Line: 6
Error: Syntax Error
Anonymous
22 Apr 2004, 09:47Been away a while, but seeing as though no-one else has stepped in, better late than never
Try this (slightly re-worked) code...
There seemed to be a bit of confusion in the way you used the javascript & html 'comment markers' in the original efforts
Al (MaDbRiT)
Try this (slightly re-worked) code...
<html>
<head>
<title>Contact Us - CodingMasters</title>
<!-- Hide the script from non javascript browsers
<script language="javascript">
//function
formcheck;
if (document.formmail.body.value =="") || (document.formmail.changes.value =="");
{alert("You did not fill in the comments or changes box!");
return false};
else;
{return true};
//-End of function
</script>
-->
</head>
<body>
<P align="center"><FONT size="7" color="brown">CodingMasters</FONT></P>
<P align="center">"We give you what <EM>you</EM> want!"</P>
<BR>
<BR>
<center>
Here you can contact us using this form<BR>
<BR>
If <FONT color="#ff0000">*</FONT> is next to a field, it is compulsary<BR>
<form name="formmail" action="/cgi-bin/formmail/formmail.cgi" method="post" onSubmit=return "formcheck">
<input type="hidden" name="recipient" value="codingmasters@yahoo.com.au" style="WIDTH: 185px; HEIGHT: 22px" size="23">
<p><b>Your Name:</b> <input name="realname" size="45"></p>
<br>
<p><b>Your Email Address:</b> <input name="email" size="45"></p>
<br>
<p><b>Comments or Suggestions:</b><br>
<TEXTAREA name="body" rows="8" wrap="virtual" cols="60"></TEXTAREA><FONT color="#ff0000">*</FONT></p>
<br>
<p><b>What would you change about the site:</b><br>
<TEXTAREA name="changes" rows="8" wrap="virtual" cols="60"></TEXTAREA><FONT color="#ff0000">*</FONT></p>
<br>
<p><b>Would you reccomend this site to your friends:</b><br>
<input type="radio" name="friends" value="Yes" checked><input type="radio" name="friends" value="No">
<FONT color="#ff0000">*</FONT>
<p><input type="submit" value="Send Email"> <input type="reset" value="Reset Form"></p>
</form>
<br>
<br>
E-Mail us @ <A HREF="mailto:codingmastershelp@yahoo.com.au">codingmastershelp@yahoo.com.au</A><BR>
<BR>
<A HREF="maillist.htm">Back</A>:<A HREF="index.html">Home</A><br>
This site is hosted by <A HREF="http://www.aurorahost.net">AuroraHost</A>
</center>
</body>
</html>
There seemed to be a bit of confusion in the way you used the javascript & html 'comment markers' in the original efforts
Al (MaDbRiT)
GameBoy
22 Apr 2004, 17:04forms are best in PHP i thinks
paul_one
22 Apr 2004, 19:53That they are Ste - that they are..... Alot easier to use something that's almost function-like.
007bond
29 Apr 2004, 07:03I'm using VB6 and I'm doing a project on Space. I need to know how to create and delete an Image control.
Any help would be appreciated.
007bond
Any help would be appreciated.
007bond
Anonymous
29 Apr 2004, 08:09007 Bond wrote;
The image control doesn't appear on your default set of controls in VB6, it has to be added by adding the "Microsoft Common Controls 6" (if I remember correctly, don't have VB6 on this PC)
In the VB workspace, select the PROJECT menu, then COMPONENTS in the tabbed dialog that pops up (it should default to the CONTROLS tab) you have a scrollable list of controls you can add to your toolbox (n.b. for this project only!)
Scroll down the list until you find MICROSOFT COMMON CONTROLS 6.0 - tick the appropraite box and then click APPLY.
You will now have a few extra controls to play with in your toy box... oops TOOL box...
I THINK MCC6.0 adds a tabbed dialog control, toolbar control, status bar control, progress bar control, treeview control, listview control, imagelist control, slider control & an image combo control.
Using any of these is easy as drag and dropping/ double clicking - just like any other VB control.
Al (MaDbRiT)
I'm using VB6 and I'm doing a project on Space. I need to know how to create and delete an Image control
The image control doesn't appear on your default set of controls in VB6, it has to be added by adding the "Microsoft Common Controls 6" (if I remember correctly, don't have VB6 on this PC)
In the VB workspace, select the PROJECT menu, then COMPONENTS in the tabbed dialog that pops up (it should default to the CONTROLS tab) you have a scrollable list of controls you can add to your toolbox (n.b. for this project only!)
Scroll down the list until you find MICROSOFT COMMON CONTROLS 6.0 - tick the appropraite box and then click APPLY.
You will now have a few extra controls to play with in your toy box... oops TOOL box...
I THINK MCC6.0 adds a tabbed dialog control, toolbar control, status bar control, progress bar control, treeview control, listview control, imagelist control, slider control & an image combo control.
Using any of these is easy as drag and dropping/ double clicking - just like any other VB control.
Al (MaDbRiT)
Anonymous
29 Apr 2004, 08:13Oh yeah - I was assuming above that you didn't mean the standard 'image' control on the default toolbar! I'm sure you don't need help finding/using that...
do you?
Al (MaDbRiT)
do you?
Al (MaDbRiT)
007bond
01 May 2004, 09:11Sorry, I meant at runtime, not at design time.
And for the record an Image Control is part of the intrisc collection of controls in VB6
007bond
And for the record an Image Control is part of the intrisc collection of controls in VB6
007bond
paul_one
02 May 2004, 02:34can;t you just change the visibility to true and to false??
007bond
02 May 2004, 03:35No, because the user doesn't necessarily have to click on the button.
I guess I should give a bit more background info:
It's a school project.
It's basically a seven form app: The main form, The about form, the planets form, the stars form, the Sun form, the martians form and the game form.
The 3rd to the 6th form each have buttons on them which changes the text in the texbox and shows an image. However, one button requires a second image to be shown. So, I need the image to be created at runtime.
Hope that helps.
007bond
I guess I should give a bit more background info:
It's a school project.
It's basically a seven form app: The main form, The about form, the planets form, the stars form, the Sun form, the martians form and the game form.
The 3rd to the 6th form each have buttons on them which changes the text in the texbox and shows an image. However, one button requires a second image to be shown. So, I need the image to be created at runtime.
Hope that helps.
007bond
007bond
02 May 2004, 06:25don't worry, I've found a way to view the second picture without having to create another image control at runtime
007bond
007bond