473,563 Members | 2,904 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP Forms - Hiding the action part in form tag

8 New Member
Hi,

I have created a form which has a text box and a submit button....
Expand|Select|Wrap|Line Numbers
  1. <form name="myform" action="new.asp" method="post">
  2. <input type="text" name="text1" size=20>
  3. <input type="submit" value="Submit">
  4.  
However, I want to hide the name "new.asp" from being displayed when the user clicks view source in the browser. The source code should look like this..
Expand|Select|Wrap|Line Numbers
  1. <form name="myform" action="" method="post">
  2. <input type="text" name="text1" size=20>
  3. <input type="submit" value="Submit">
  4.  
Is there any way to hide the action attribute of the form tag? I tried putting the "new.asp" in <% %> delimiters. Though it is hiding the name in the source code, it is not navigating to that asp page.

Hope the problem is clear.. Can someone pleassssse help?
Thanks a lot.

Pradeep.
Dec 4 '07 #1
5 1805
jhardman
3,406 Recognized Expert Specialist
No, please remember that HTML was designed to be visible, so any user could see the code behind. There are a couple tricks you could use to make it less clear, you could use javascript to fill in the action attribute after the page is loaded for example. You could also have the action go to one page, but then redirect to another page which actually handles the form. Or you could have the form handler be in some sort of "include" code, it is never shown where the include code comes from. Let me know if this helps.

Jared
Dec 5 '07 #2
kpdeepu
8 New Member
No, please remember that HTML was designed to be visible, so any user could see the code behind. There are a couple tricks you could use to make it less clear, you could use javascript to fill in the action attribute after the page is loaded for example. You could also have the action go to one page, but then redirect to another page which actually handles the form. Or you could have the form handler be in some sort of "include" code, it is never shown where the include code comes from. Let me know if this helps.

Jared
Hey

The idea of putting one page in the action attribute and then redirecting to other page is fine.. Thanks.. But, see this page and the source code. How come they have managed to hide the action attribute?

http://www.iimi-iris.com/iris-2007/i...eless3/666.asp

This page is part of a puzzle in which the page navigates to the next page only if you enter the correct answer.. Please have a look at the action attribute in the src code.
Dec 7 '07 #3
aspdevguy
4 New Member
The reason why you are not seeing the ACTION tag page name is because they post the page to itself. It then does the processing of your answer and redirects you to whereever you need to go.

You can also try implementing some JavaScript functions and hide the action tag someplace else in the script, but I don't think there is a way to completely hide it.
Dec 7 '07 #4
jhardman
3,406 Recognized Expert Specialist
devguy is right. I like to explicitly state that attribute regardless, but if you don't specify an action, it just posts to the same page. Notice, that approach is very similar to what I suggested: post to one page and then redirect.

Jared
Dec 7 '07 #5
kpdeepu
8 New Member
Thank you both!
:)
Dec 10 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

10
3382
by: Chris Leffer | last post by:
Hi. If I have two forms in the same asp page: <form name='firstForm' action='myPage.asp'> </form> <form name='secondForm' action='myPage.asp'> </form>
13
2045
by: Ian Hickson | last post by:
A group of us have been unofficially working on a proposal of extensions to HTML4's Forms chapter, and would like to get input from a wider range of people now that we think our draft proposal is reaching a stable stage: http://www.whatwg.org/specs/web-forms/2004-06-27-call-for-comments/ Some of the features we are proposing include new...
22
2156
by: Mr Newbie | last post by:
I was thinking about developing a workflow application yesterday and was musing over the different approaches than one could take in restricting specific actions on a ticket( Form ) at any said stage. One approach I have used on other systems is to prevent the action buttons appearing. For example, if one did not have the Role of...
1
11969
by: Viken Karaguesian | last post by:
Hello everyone, Just wanting some advice. I'd like to start removing the Microsoft-generated guestbook (a feature of FrontPage) on my websites but I'm not sure if it can be done just using HTML. There seems to be a lot of server-side processing going on. The guesbooks are setup in such a fashion that when user submits an entry, not only is...
11
2949
by: Kevin | last post by:
I've got a timer on my MDI parent form. If there's no mouse movement for a set number of minutes, the Visible property of all open forms is set to False and the Log On form is displayed. I could do it in VB6. In VB2005 I can get a list of all the open forms, but I get an error after hiding the first one. This is what I'm trying to use: ...
2
3811
by: goresus | last post by:
Hello, I have prepared a form and it is in its final stage. One thing that remains is the following: when I click a submit button in the page, all the information in the page, from different forms, needs to be collected and entered into a table. I have created a new form with a button and once I click that button, it calls a new php...
19
248061
Atli
by: Atli | last post by:
Introduction At some point, all web developers will need to collect data from their users. In a dynamic web page, everything revolves around the users input, so knowing how to ask for and collect this data is essential to any developer. This article is a basic tutorial on how to user HTML Forms, the most common method of data collection. ...
12
1480
by: kronecker | last post by:
I found this nifty routine that closes a form one by one every time it is called. However, I need to hide them instead of closing them. Is there a way to alter the code? I assume it has something to do with this line here... PostMessage(i, CInt(&H10), vbNullString, vbNullString) Thanks
12
11038
by: raylopez99 | last post by:
Keywords: scope resolution, passing classes between parent and child forms, parameter constructor method, normal constructor, default constructor, forward reference, sharing classes between forms. Here is a newbie mistake that I found myself doing (as a newbie), and that even a master programmer, the guru of this forum, Jon Skeet, missed!...
0
7583
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7885
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7638
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7948
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6250
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3642
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1198
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
923
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.