Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: General / Classic ASP versions(v3.4.XX)
 Default Registration Values
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

Lydecker
Junior Member

United Kingdom
297 Posts

Posted - 20 August 2002 :  16:13:27  Show Profile  Visit Lydecker's Homepage
If I wish to place default values in the registration fields (e.g - Username) - which page do I add the values to?

I can't seem to find it on the register.asp page, thereofore it must be on one of the included pages...

Thanks

Roland
Advanced Member

Netherlands
9335 Posts

Posted - 20 August 2002 :  16:17:02  Show Profile
inc_profile.asp

It's a bit more complex than it was for 3.3.x so be careful and test it before you put it live
Go to Top of Page

Lydecker
Junior Member

United Kingdom
297 Posts

Posted - 20 August 2002 :  16:28:32  Show Profile  Visit Lydecker's Homepage
Boy you wern't kidding

FrutZle, could you give me an example on how I would modify the code to make the default value for the Username appear as 'Jim'.

Thanks for you time.
Go to Top of Page

Lydecker
Junior Member

United Kingdom
297 Posts

Posted - 23 August 2002 :  11:32:56  Show Profile  Visit Lydecker's Homepage
Anyone

THanks
Go to Top of Page

Roland
Advanced Member

Netherlands
9335 Posts

Posted - 23 August 2002 :  12:09:34  Show Profile
look for if strMode = "Register" then and add the text you want in the textbox by default as value=""yourtext"" where you replace yourtext with the text you want in the textbox.

You will want to add the text you put in the username field to be in the "username filter" to prevent anyone from using it as their username though Also, checking for those default values on register.asp (that's used when the form is submitted) and then giving an error when the field contains the default value when it's a required field (for example the email field), or not writing the info into the database if it's not a required field (for example the "bio" or "signature" fields), would be a good idea.
Go to Top of Page

Lydecker
Junior Member

United Kingdom
297 Posts

Posted - 24 August 2002 :  14:53:58  Show Profile  Visit Lydecker's Homepage
Okay - so I am trying to place a default value in the password field. THis value is to be requested from a cookie. Currently I have used the following code:

quote:
<input name=""Password"" size=""25"" maxLength=""25"" value=""&Request.cookies('Spooky')('T2aPd')"">


But this seems to display the value
quote:
Request.cookies('Spooky')('T2aPd')
when the page is loaded. How do I make it read it as .asp code? so it actually displays the password from the cookie?

Thanks!
Go to Top of Page

Roland
Advanced Member

Netherlands
9335 Posts

Posted - 24 August 2002 :  14:56:51  Show Profile
you need to make it
value=""" & Request.Cookies("Spooky")("T2aPd") & """>
Go to Top of Page

Lydecker
Junior Member

United Kingdom
297 Posts

Posted - 24 August 2002 :  16:59:25  Show Profile  Visit Lydecker's Homepage
Okay almost there now - promise

I have my default fields working with cookies for the two password fields, and the second email. The first email .asp code is different though. How do I add a default email address to this code:

quote:
<input name=""Email"" size=""25"" maxLength=""50"" value="""
if strMode <> "Register" then Response.Write(ChkString(rs("M_EMAIL"), "display"))
Response.Write """>" & vbNewLine & _


Many thanks for all this
Go to Top of Page

Roland
Advanced Member

Netherlands
9335 Posts

Posted - 24 August 2002 :  17:33:40  Show Profile
<input name=""Email"" size=""25"" maxLength=""50""
if strMode <> "Register" then
Response.Write " value=""" & ChkString(rs("M_EMAIL"), "display")) & """>" & vbNewline
else
Response.Write ">" & vbNewLine
end if


This inserts the default value when you're not registering. You can add the value part with a default text in the second Response.Write if you want a default value when someone is registering.
Go to Top of Page

Lydecker
Junior Member

United Kingdom
297 Posts

Posted - 24 August 2002 :  18:09:40  Show Profile  Visit Lydecker's Homepage
quote:
vbNewline
else
Response.Write ">" & vbNewLine
end if



This is getting a tad confusing, because I cant actually find this code (the 2nd response.write) you show above.... Please could you give me the whole email section code chunk, and highlight where I bung the value tag in.

many thanks
Go to Top of Page

Roland
Advanced Member

Netherlands
9335 Posts

Posted - 24 August 2002 :  18:26:15  Show Profile
I modified the code you posted and added a second Response.Write
Go to Top of Page

Lydecker
Junior Member

United Kingdom
297 Posts

Posted - 24 August 2002 :  18:42:21  Show Profile  Visit Lydecker's Homepage
quote:
Originally posted by FrutZle

I modified the code you posted and added a second Response.Write



I can't see any modification on the code I posted

(really sorry about this!)
Go to Top of Page

Roland
Advanced Member

Netherlands
9335 Posts

Posted - 24 August 2002 :  18:49:32  Show Profile
Compare:

<input name=""Email"" size=""25"" maxLength=""50"" value="""
if strMode <> "Register" then Response.Write(ChkString(rs("M_EMAIL"), "display"))
Response.Write """>" & vbNewLine & _


vs.

<input name=""Email"" size=""25"" maxLength=""50""
if strMode <> "Register" then
Response.Write " value=""" & ChkString(rs("M_EMAIL"), "display")) & """>" & vbNewline
else
Response.Write ">" & vbNewLine
end if


I see quite a difference. For example, you can now easily add a default value when someone registers by adding value=""something"" to the line in red which you didn't have in the original code. Secondly, it looks more readable
Go to Top of Page

Lydecker
Junior Member

United Kingdom
297 Posts

Posted - 25 August 2002 :  07:48:17  Show Profile  Visit Lydecker's Homepage
Here is my current email code:
quote:
<input name=""Email"" size=""25"" maxLength=""50""
if strMode <> "Register" then
Response.Write " value=""" & ChkString(rs("M_EMAIL"), "display")) & """>" & vbNewline
else
Response.Write ">" & vbNewLine
end if


But with this I seem to get a Unterminated string constant error:

/buffy/forum/inc_profile.asp, line 72

" <td bgColor=""" & strPopUpTableColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><input name=""Email"" size=""25"" maxLength=""50""
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------^
Go to Top of Page

Roland
Advanced Member

Netherlands
9335 Posts

Posted - 25 August 2002 :  10:08:21  Show Profile
well you only showed me a part of your code. Try adding " to the end of the first line (the one ending with maxlength=""50"")
Go to Top of Page

Lydecker
Junior Member

United Kingdom
297 Posts

Posted - 25 August 2002 :  11:20:21  Show Profile  Visit Lydecker's Homepage
I thought I did show you all of the code (I haven't added the default value yet, just trying to rid the errors first!). Anyways, my errors seem to be going round in circles, any chance I could send you the inc_profile.asp page for you to take a peek at If you have the time to do this that would be great, many thanks
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.36 seconds. Powered By: Snitz Forums 2000 Version 3.4.07