MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 21st, 2004, 06:06 PM
Sandow Sandow is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 10 Sandow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question InputBox and MySQL

Hi,
I need to make an InputBox() with three functions... One Makes it required, The next checks if it's a valid email and the third will write it to a MySQL database. If anyone can direct me in the right direction or knows where I can find a tutorial/information on how to go about doing this, I would much appreciate it.

P.S. I have done many searches and came up with nothing other than a standard InputBox. Am I even phrasing this question correctly?

Thank You,

Donna

Reply With Quote
  #2  
Old January 21st, 2004, 06:27 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 8 m 57 sec
Reputation Power: 9
Send a message via ICQ to stumpy Send a message via MSN to stumpy
For what language? HTML, VB?

Reply With Quote
  #3  
Old January 21st, 2004, 06:44 PM
Sandow Sandow is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 10 Sandow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
i was thinking vb, most of my pages are done in asp, i do have alot of vb throughout the site with some js. but i really don't care what language it is as long as the end result is the same... haha

Thanx again...

Donna

Reply With Quote
  #4  
Old January 21st, 2004, 06:56 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 8 m 57 sec
Reputation Power: 9
Send a message via ICQ to stumpy Send a message via MSN to stumpy
Going with ASP/HTML - Use Javascript to make the box required, then do it again in ASP. Ditto for the validation.

The writing to the database part is quite simple, and there are tutorials everywhere on how to do this.

Reply With Quote
  #5  
Old January 21st, 2004, 06:57 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 8 m 57 sec
Reputation Power: 9
Send a message via ICQ to stumpy Send a message via MSN to stumpy
BTW - I use this function to validate email in ASP
Code:
function validateEmail(strEmailAddress)

	Dim objRegExp
	Set objRegExp = New RegExp

	objRegExp.IgnoreCase = True

	objRegExp.Pattern = "^[\w-\.]{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]{2,3}$"
	
	if objRegExp.Test(strEmailAddress) then
		bResult = true
	else
		bResult = false
	end if
	
	validateEmail = bResult

end function

Reply With Quote
  #6  
Old January 21st, 2004, 07:05 PM
Sandow Sandow is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 10 Sandow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thank you, how to incorporate that into my InputBox()? I know how to do it if I was to use a form. But this is just an InputBox that pops up and my client wants it to be required before the user goes to the next page and validate the email and send it to a database.... ugg ???

Reply With Quote
  #7  
Old January 21st, 2004, 07:20 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 8 m 57 sec
Reputation Power: 9
Send a message via ICQ to stumpy Send a message via MSN to stumpy
Making a text box (<input type="text">) required has to be done via Javascript AND ASP. If a user was to turn off Javascript in their browser, then you need to fall back on ASP.

You can write a little JS "required" script by using the onSubmit event handler in your HTML form.
Code:
<form name="frmFoo" onSubmit="return isRequired()">
The JS would go something like:
Code:
if (document.frmFoo.txtBar.value == "") {
  return false
else
  return true
}

Reply With Quote
  #8  
Old January 21st, 2004, 07:24 PM
Sandow Sandow is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 10 Sandow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thank you again for the reply, but I t is not a form it is an InputBox which is VB or i could use a prompt whick is js. I know how to validate a form and i can make the prompt or inputbox required but i can't seem to make it do all three things at once.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > InputBox and MySQL


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway