473,394 Members | 1,916 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

what's the difference, URL in FORM tag and in INPUT tag

Hi

I'm not good at javascript and wondering the difference, URL in FORM
tag and in INPUT tag.

ex
1.
<FORM name="Form1" id="InputForm" method="post" action="url">
<INPUT TYPE="HIDDEN" NAME="nn" VALUE="">
2.
<form name="Form2">
<table ID="SelectPanelTable"...>
<tr> <TD ID="TD".. onmouseup=function()>
3.
<FORM name = "Form3">
<INPUT TYPE=Hidden NAME="aa"
4.
<FORM name = "Form4" onsubmit=url>
<INPUT TYPE=Hidden NAME="aa"..>
5.
<FORM name = "Form5" onsubmit=url>
<INPUT TYPE=button NAME="aa"..>

questions from above cases:
1. when need to use "action"
2. different in 4 and 1?
3. if no button, how to triger submit?
4. the where/how to specify URL, in <form> tag or in its sub-tag?
5. when use onclick, onsubmit,onmouse to direct next page?

--
Thanks lots
John
Toronto

Jul 23 '05 #1
1 1560
john woo wrote:
1.
<FORM name="Form1" id="InputForm" method="post" action="url">
4.
<FORM name = "Form4" onsubmit=url> 1. when need to use "action"
Every time you use a form. Its a required attribute.
2. different in 4 and 1?
1 is sane.

4 attempts to treat a URL as some unspecified client side scripting (most
browsers will treat it as JavaScript, but you should specify this
explicitly http://www.w3.org/TR/html4/interact/....html#h-18.2.2 (of
course URLs aren't JavaScript so this will just break))
3. if no button, how to triger submit?
http://ppewww.ph.gla.ac.uk/~flavell/...mquestion.html
(But its always a good idea to have a submit button)
4. the where/how to specify URL, in <form> tag or in its sub-tag?
The action attribute of the <form>.
5. when use onclick, onmouse to direct next page?
Its almost always a very bad idea to submit forms using anything other then
then a regular submit button with no need for client side scripting.
5. when use onsubmit to direct next page?


Never. Use this to stop the form being submitted when certain conditions are
or are not met with client side code (but don't depend on it working)

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: michaaal | last post by:
What is the difference between these two statements? They seem to do the same thing... response.write(request("variable")) response.write(request.querystring("variable"))
4
by: JJ_377 | last post by:
Why won't Netscape do the intended in the following? IE is able to render this page as intended. It is is a "self-posting" ASP form with a JavaScript validation function: if the form fails the...
3
by: ling | last post by:
Hi, I'm trying to do fscanf from a file with integers. I've tried using both %d and %i hoping that I would figure out their difference. When I checked the man pages, the only difference I...
7
by: David Laub | last post by:
I have stumbled across various Netscape issues, none of which appear to be solvable by tweaking the clientTarget or targetSchema properties. At this point, I'm not even interested in "solving"...
8
by: bdobby | last post by:
Hi. I am relatively new to js, but I did think I was starting to get the hang of it. Then this happened... I have a form with an onsubmit event handler: <form id="uploadForm" method="post"...
10
by: Man-wai Chang | last post by:
Why 2 reference points? -- iTech Consulting Co., Ltd. Expert of ePOS solutions Website: http://www.itech.com.hk (IE only) Tel: (852)2325 3883 Fax: (852)2325 8288
12
by: Eric Layman | last post by:
Hi, What's the difference between a normal web element: <input type="text" id="txtname" name="txtname" runat="server"> vs webcontrol text box: <asp:Textbox id="username" Columns="10"...
34
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - What online resources are available? ----------------------------------------------------------------------- *...
9
by: viki1967 | last post by:
Hi all! This new forum its great! :) Congratulations !!! My answer: why this my code not working? Nothing error but not work the difference.... : <html>
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.