Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Confirmation - VBscipt of Javascipt

Status
Not open for further replies.

timcadieux

Programmer
May 25, 2005
129
BE
Ok, i use the below code to requset a new FolderName from the Client and when they hit Submit, I want to present a confirmation of some sort with what the new Path would look like (response.Write(request.form("path") & "/" & request.form("FolderName"))..

However, i'm not sure the best way to go, everyone always say use Javascript to do this but how do I refer to the Form Fields, request the confirmation and then depending on the answer, either Process a new ASP page or SUB or if the answer No, Redirect them back to a particular page?

If anyone know of a clean script already that would allow me to do this type of thing, i'd love to see it, mine works but i find it kind of nasty.


Code:
<% elseif request.QueryString("action")="add" then %>

<form action="<%= SCRIPT_NAME %>?action=addFolder" method="post">
<input type="text" name="FolderName">
<input type="hidden" name="path" value="<%=request.QueryString("path")%>">
		<input type="submit">
</form>

<%	elseif  request.QueryString("action") ="addFolder" then %>


	What to do?

<% End if%>
 
Did you mean something like this:

<% elseif request.QueryString("action") ="addFolder" then %>

<script type="text/javascript">
alert("Folder Created")
window.location= "yourpage.asp"
</script>

<% End if%>

-DNG
 
also if you want to access form elements...

then soemthing like this should work...

the below is just an example:
Code:
<form name="personal" action="something.asp" onsubmit="showconfirmation()">
<input type=text size=20 name=name>
<input type=text size=20 name=address>
<input type=text size=20 name=city>
</form>

Now you can access these elements by:

document.personal.name
document.personal.address
document.personal.city

and you can have the showconfirmation() function something like i have shown in my previous post...

-DNG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top