Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Any Ideas on how to change the Check New Username to work on an update form instead of an insert form

Explorer ,
Feb 04, 2008 Feb 04, 2008
Hi All,

I think I've attached the code below, which checks whether a Username already exists in the table, I've slightly ammended this, as i have a number of sites accesing the database, so i'm checking against the siteId also (you will see i have added the following code AND JBACASiteID = '1'") -

As I'm using the email address as the Username, and email addresses can change, I've given (or would like to) the user the option of changing their username, what I haven't done is applied the Check New Username behaviour to this.

Does anyone have any ideas as to how best to apply the Check New Username to the Update Record behaviour, and include the check against SiteID?

Many thanks
TOPICS
Server side applications
329
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Feb 04, 2008 Feb 04, 2008
I have modified the checkusername behavior for asp and the code will work, but not be editable with the DW wizard.
Just change the second line
' *** Redirect if username exists
MM_flag = "MM_insert"

TO:
MM_flag = "MM_update"

If you made your update for with the DW update record wizard there is a hidden field that is added. If its not
<input type="hidden" name="MM_flag" value="MM_Update" />
Then change the values in the code to whatever your form has.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 05, 2008 Feb 05, 2008
LATEST
Hi Mike,

Thanks for that, it worked nicely, mind if I ask another question, very similar -
I have a page (register.asp) with a Form (Form1) which posts the data to another page (afterregistration.asp), where a Stored Procedure inserts the data from register.asp into two tables.
The stored procedure works great, but as again here I have failed to check the the value which is being inserted into the Username field I am risking a dodgy login (the value is a textfield called email) the table and column that I need to check against is dbo.JBEmployee (table) JBEUserEmail and again I only need to check where the JBESiteID is the same as the siteid value posted by the form.

Is there anyway of checking this information on a Form Post, and if it does not redirecting to afterregistration.asp or if already exists redirecting to a registrationfailure.asp page?

Appreciate your help with this..

GTN
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines