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

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 forms
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

GBurch
Junior Member

United Kingdom
107 Posts

Posted - 13 July 2001 :  17:36:45  Show Profile
This isn't strictly an ASP question, but it's part of an ASP system, so I guess it counts.

How do I write the data entered into a field in a form to a variable, which can then be used to build a URL.


http://www.captgb.dabsol.co.uk
http://www.slipstreamservices.com

Id
Junior Member

USA
129 Posts

Posted - 13 July 2001 :  17:39:07  Show Profile  Visit Id's Homepage
something to the effect of this is what i'm guessing you want.


<%
urlVariable = Request.Form("FormName")
%>
<a href="<%=urlVariable%>.asp">LinkName[or <%=urlVariable%>]</a>


Edited by - Id on 13 July 2001 17:42:13
Go to Top of Page

GBurch
Junior Member

United Kingdom
107 Posts

Posted - 13 July 2001 :  17:50:57  Show Profile
Where do you define the particular field that you want the value of?

http://www.captgb.dabsol.co.uk
http://www.slipstreamservices.com
Go to Top of Page

Spoon
Average Member

Ireland
507 Posts

Posted - 13 July 2001 :  18:07:32  Show Profile  Visit Spoon's Homepage  Send Spoon an ICQ Message
Try this:
----
Here is the form to enter the url:
-----------

<form method="post" action="buildurl.asp">
<input type="text" name="NEWURL">
<input type="submit" name="submit" Value="submit">
</form>

------------
Here is the ASP PAGE THAT COLLECTS IT
---------------------------------------

<% @LANGUAGE="VBSCRIPT"
ENABLESESSIONSTATE = FALSE
%>
<%
Response.Buffer = TRUE
%>
<%
Dim BUILDURL
BUILDURL = Request.Form("NEWURL")
' Above is where we decide what textbox we want to pick
%>
<a href="<%=BUILDURL%>">New Link</a>



Thats it! Easy Huh?

Regards,

Spoon



"uohh look at me, ive got a signature, uohh look at me!" :)
Go to Top of Page

Id
Junior Member

USA
129 Posts

Posted - 13 July 2001 :  18:10:04  Show Profile  Visit Id's Homepage
you'd do it on a form on either a different subroutine, or on an html page, and then you have the asp do the hardwork

something like this

code for form.htm

<html>
<body>
<form action="form.asp" method="post"
<input type=text name=url>
<input type=submit name=submit value=submit>
</form>
</body>
</html>

Then for the asp page
form.asp code:

<%
Dim strURL
strURL = Request.Form("url")
%>
<html>
<body>
<a href="<%=strURL%>.htm">Here's your url</a>
</body>
</html>

I hope i'm going in the right direction with what you want here, so if i'm off by a mile or so, let me know :)

Go to Top of Page

Id
Junior Member

USA
129 Posts

Posted - 13 July 2001 :  18:11:30  Show Profile  Visit Id's Homepage
Well gee thanks spoon way to steal all my glory

Go to Top of Page

Spoon
Average Member

Ireland
507 Posts

Posted - 13 July 2001 :  18:23:25  Show Profile  Visit Spoon's Homepage  Send Spoon an ICQ Message
quote:

Well gee thanks spoon way to steal all my glory



HeHe! :P

Hope you didnt spend much time on it! lol

Anyway, great minds think alike!

Regards,

Spoon

"uohh look at me, ive got a signature, uohh look at me!" :)
Go to Top of Page
  Previous Topic Topic Next Topic  
 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.33 seconds. Powered By: Snitz Forums 2000 Version 3.4.07