Jump to content

Need help with two JS


Mimika

Recommended Posts

Iam after two scripts 1.A script who vertifes that the e-mail adress like this ex."Invented@hotmail.com" are correct displayed in the form so you can not type "dfgdg" and be able to send it, the code you can find in this Topic under post 10~2. A script who can change banners random on page load got 10 banners and they will be displayed inside a table

<td width="570"><img src="banner-(3).gif" width="570" height="60"></td>

this are not related to the link for the 1st script this is another side prodject------------------ thnx in advance for the help :)

Link to comment
Share on other sites

1.

<script type="text/javascript">/************************************************ Email Validation script- © Dynamic Drive (www.dynamicdrive.com)* This notice must stay intact for legal use.* Visit http://www.dynamicdrive.com/ for full source code***********************************************/var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/ifunction checkmail(e){var returnval=emailfilter.test(e.value)if (returnval==false){alert("Please enter a valid email address.")e.select()}return returnval}</script><form><input name="myemail" type="text" style="width: 270px"> <input type="submit" onClick="return checkmail(this.form.myemail)" value="Submit" /></form>
Just put "name="myemail"" in the text box of the email textbox, and in the submit button put this: "onclick="return checkmail(this.form.myemail)""2. This should do it:http://www.javascriptkit.com/script/cut149.shtmlI hope that helped. :)
Link to comment
Share on other sites

thnx :) iam not an expert on JSwill try learn it later when i have more time over :(will try them nowEDIT---------------for script 2 it didnt work as nice maybe cause i did something wrong but here is a script that worked much better just found it on google :D

<script LANGUAGE="Javascript"><!--function banner() {}; b = new banner(); n = 0//-----------------------------Database----------------------------b[n++]= "<A HREF='http://www.link1.com'><IMG SRC='image1.gif' BORDER='0' ALT='??'></A>"b[n++]= "<A HREF='http://www.link2.com'><IMG SRC='image2.gif' BORDER='0' ALT='??'></A>"b[n++]= "<A HREF='http://www.link3.com'><IMG SRC='image3.gif' BORDER='0' ALT='??'></A>"b[n++]= "<A HREF='http://www.link4.com'><IMG SRC='image4.gif' BORDER='0' ALT='??'></A>"b[n++]= "<A HREF='http://www.link5.com'><IMG SRC='image5.gif' BORDER='0' ALT='??'></A>"b[n++]= "...just keep adding to database"//------------------------------------------------------------------i=Math.floor(Math.random() * n); document.write( b[i] )//--></SCRIPT>

will test script 1 now :)EDIT 2-----script 1 was really nice it worked perfectly ;Pthnx again :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...