473,221 Members | 1,971 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,221 software developers and data experts.

need some newbie help...

Hi fellow web developers!

I have a little problem due to my lack of javascript / web developing
skills...

Basically I have a form embedded in a table. WHat I would like to do,
is have the form be submitted when I click on a href link. Currently
it appears that the page reloads - but nothing actually is submitted.

here is a demo code,,, is it something in the head?

<html>
<head>
<SCRIPT language="JavaScript">
function submitCode()
{
document.ApplyCode.submit();
}
</SCRIPT>
</head>
<body>

<table>
<tr>
<td>
<form action="thisPage.jsp" name="SubmitCode"
method="post">
Code:
<input type="text" name="Code" />
<!-- this is the line that doesnt work right -->
<a href="thisPage.jsp"
onClick="javascript: submitCode()">
Click Me
</a>
</form>
</td>
</tr>
</table>

</body>
</html>
Sep 25 '08 #1
3 1271
On Sep 25, 1:51*am, trfilmograp...@gmail.com wrote:
Hi fellow web developers!

I have a little problem due to my lack ofjavascript/ web developing
skills...

Basically I have a form embedded in a table. *WHat I would like to do,
is have the form be submitted when I click on a href link. *Currently
it appears that the page reloads - but nothing actually is submitted.

here is a demo code,,, is it something in the head?

<html>
<head>
<SCRIPT language="JavaScript">
* * * * function submitCode()
* * * * {
* * * * * document.SubmitCode.submit();
* * * * }
</SCRIPT>
</head>
<body>

<table>
* <tr>
* * *<td>
* * * * * *<form action="thisPage.jsp" name="SubmitCode"
method="post">
* * * * * * * * * * * * Code:
* * * * * * * * * * * * <input type="text" name="Code" />
* * * * * * * * * * *<!-- this is the line that doesnt work right -->
* * * * * * * * * * * * * * * * * * * * * * * * <a href="thisPage.jsp"
onClick="javascript: submitCode()">
* * * * * * * * * * * * * * Click Me
* * * * * * * * * * * * * </a>
* * * * * * * * </form>
* * </td>
*</tr>
</table>

</body>
</html>
oops - Just so you know, there is still an issue, but the demo above
mis-named the form in the javascript... still need some guidance..
Sep 25 '08 #2
SAM
Le 9/25/08 8:16 AM, tr************@gmail.com a écrit :
On Sep 25, 1:51 am, trfilmograp...@gmail.com wrote:
>Hi fellow web developers!

oops - Just so you know, there is still an issue, but the demo above
mis-named the form in the javascript... still need some guidance..
You must stop the HTML link
(with return false;)

E.G. :

<a href="page.htm"
onclick="alert(this.href); return false;">href</a>
page's code :
-------------

<html>
<head>
<script type="text/javascript">
function submitCode()
{
document.SubmitCode.submit();
return false;
}
</script>
</head>
<body>
<table>
<tr>
<td>
<form action="thisPage.jsp" name="SubmitCode"
method="post">
Code:
<input type="text" name="Code" />
<!-- this is the line that doesnt work right -->
<a href="thisPage.jsp"
onclick="return submitCode()">
Click Me
</a>
</form>
</td>
</tr>
</table>
</body>
Sep 25 '08 #3
tr************@gmail.com wrote:
On Sep 25, 1:51 am, trfilmograp...@gmail.com wrote:
>I have a little problem due to my lack ofjavascript/ web developing
skills...
[...]
here is a demo code,,, is it something in the head?

[junk removed]

oops - Just so you know, there is still an issue, but the demo above
mis-named the form in the javascript... still need some guidance..
You should learn HTML before you make an attempt at Web programming.

<http://validator.w3.org/>
PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee
Sep 26 '08 #4

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

Similar topics

11
by: rigga | last post by:
Hi, I am trying to code a menu for a webpage, the menu is broken up to groups i.e: Home Group1  menuitem1  menuitem2  menuitem3
1
by: Inyeol Lee | last post by:
I'm an OOP newbie, and needs help on subclassing from different module. I made a base module a.py which contains two classes C1 and C2; ## start of a.py class C1(object): def m(self):...
3
by: Newbie | last post by:
I am extremely new to the working of XML. Our client wants us to access their Website. They also want us to retrieve XML (files?) from their site. We will then somehow import it into our SQL...
4
by: ashmangat | last post by:
Hey I am new, but I don't have time to intruduce myself yet. I am intro to C++ and this is a programme I have to write. all the direction are here, It will be very nice of someone to figure this...
1
by: guanfenglin | last post by:
Hi guys, I am a newbie in Visual Web Developer Express 2005. I have created a datasource bind to a ORACLE table, with a custom select query, it has a where clause to filter the id specified. ...
1
by: guanfenglin | last post by:
Hi guys, I am a newbie in Visual Web Developer Express 2005. I have created a datasource bind to a ORACLE table, with a custom select query, it has a where clause to filter the id specified. ...
2
by: XML Beginner | last post by:
I have an XML file that contains values that my application needs, so it knows which database to connect to. It also contains a configuration option so that I can specify which node to return...
3
by: R69D | last post by:
Hi, I'm real new to Java and need some help...was going through some old tutorials and need help with these questions: 1)What is “composition of methods?” How do u define the composition of...
2
by: gavilaso | last post by:
Hi, i'm completly a newbie on PHP, I'm trying to make a static site search where i'm giong to put 2 category on a combobox for query.. box 1 Citys Carolina San Juan Ponce Box 2 ...
5
by: Hunter | last post by:
Hi all, I know it may sound like dump newbie question (which is very much true, as I am a newbie, not even a real programmer), but I need to implement a calendar time clock with a millisecond...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.