Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Dreamweaver (all versions) section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 19th, 2007, 11:01 AM
Registered User
 
Join Date: Dec 2006
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default form validation

Hi,

Regarding form validation, does anyone know the code or what to do if you want only people with a certain username to be able to add to a database. So only people with the same email address extension can add entries into a database and if those email extensions dont match with a list, then the person gets a message saying invalid email. Onlypeople from company are be allowed into the website... thats why.

Reply With Quote
  #2 (permalink)  
Old January 20th, 2007, 08:46 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
Posts: 347
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Adam H-W
Default

What scripting are you wanting to use?

You can do it with a combination of ASP & Javascript; for example, something like this.

<%

if request.form("username") = "yourdomain.com" then

response.redirect("yourpage.asp")

else

%>

<script language="javascript">

window.alert("Invalid Username")

window.history.go(-1)

</script>


<form>form action="" method="post">

<input type="text" name="username">

<input type="button" value="submit" name="submit">

</form>

Reply With Quote
  #3 (permalink)  
Old January 20th, 2007, 06:24 PM
Registered User
 
Join Date: Dec 2006
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

Im using just JSP - cant use ASP because of the way the system is setup, but that code looks very good! Can you tell me what the JSP code equivalent of the ASP code in the if statement is please - that would be very helpful!!! ?:)

Reply With Quote
  #4 (permalink)  
Old January 20th, 2007, 06:27 PM
Registered User
 
Join Date: Dec 2006
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by EmWebs
 Hi,

Im using just JSP - cant use ASP because of the way the system is setup, but that code looks very good! Can you tell me what the JSP code equivalent of the ASP code in the if statement is please - that would be very helpful!!! ?:)

Opps I forgot to add.... whats the extra code you need if there are more than one permitted email addresses that can be inserted into the database, kind of the code for a.a@domain1.com OR a.a@domain2.com

Thanks

Reply With Quote
  #5 (permalink)  
Old January 21st, 2007, 01:44 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
Posts: 347
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Adam H-W
Default

I'm afraid I don't know the jsp equivalent - might have to search other forum's for that.

Reply With Quote
  #6 (permalink)  
Old January 22nd, 2007, 06:59 AM
Registered User
 
Join Date: Dec 2006
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

How good is form validation anyway? Will it always work?

I was doing some testing and for some reason it stopped working! It started allowing blanks in the table!

Do versions of IE 3+ only support validation?

Reply With Quote
  #7 (permalink)  
Old January 23rd, 2007, 10:01 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
Posts: 347
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Adam H-W
Default

It's usually pretty failsafe as long as the client machine has javascript switched on.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Standalone validation + web form validation morbo Struts 0 August 19th, 2008 04:02 AM
Form Validation Stanny Access VBA 5 December 20th, 2005 08:13 PM
Validation of Form qazi_nomi Javascript 5 August 2nd, 2004 03:49 PM
Form not refreshing after form validation Mimi Javascript How-To 0 August 25th, 2003 03:20 AM



All times are GMT -4. The time now is 06:08 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.