By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,824 Members | 1,252 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,824 IT Pros & Developers. It's quick & easy.

Link as Form submit

P: n/a
In the application I'm developing, I need a link to behave as a form
submit. I set up a little test example below and it worked fine:

<table>
<tr>
<form action="action1.cfm" method="POST" enablecab="No"
name="CareerActionPlanLink">
<td align="center">
<input type="Hidden" name="careerActionPlanID" value="7">
<a href="javascript:document.CareerActionPlanLink.sub mit();">Edit</a>
</td>
</form>
</tr>
</table>

Then I did it for real and it keeps throwing Javascript errors at me.
Can anyone look at the following code and give me a clue where I might
be going wrong. I'm using fusebox 2 with coldfusion which means that
the form will submit to the index.cfm file. The js error states "Object
does not support this method or property" or words to that effect.
Thank you very much.

<cfoutput query="getRecs">

<tr valign="middle" bgcolor="#IIf(CurrentRow Mod 2, DE('D7F991'),
DE('EDFDCC'))#">
<td height="28">Action Plan: #currentRow#</td>
<td>#CareerDirectionName#</td>
<td>#CompName#</td>
<td>#DateFormat(LastEdited,"mm/dd/yy")#</td>

<form action="#Request.Self#" method="POST" enablecab="No"
name="CareerActionPlanLink">
<input type="Hidden" name="careerActionPlanID"
value="#careerActionPlanID#">
<input type="Hidden" name="fuseaction" value="editCareerActionPlan">
<td align="center">
<a href="javascript:document.CareerActionPlanLink.sub mit();">Edit</a>
</td>
</form>


<td align="center"><a
href="#Request.Self#?fuseaction=deleteCareerAction Plan&careerActionPlanID=#careerActionPlanID#">Dele te</a></td>
</tr>

Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Cardinal wrote:
In the application I'm developing, I need a link to behave as a form
submit.
Bad idea. If the look is so important (and it shouldn't be, the button look
tells the user that it is going to do something with the form and isn't
just a regular link, its generally a bad idea to hide that information from
the user) then you can style the button to look like a link in most
browsers.
<tr>
<form action="action1.cfm" method="POST" enablecab="No"
name="CareerActionPlanLink">
<td align="center">
http://validator.w3.org/
Then I did it for real and it keeps throwing Javascript errors at me.
Can anyone look at the following code and give me a clue where I might
be going wrong.


Its a lot easier to debug code if we can see the code causing the problem
(rather then some Cold Fusion code that when executed will generate the
HTML and JavaScript that you are having trouble with)
--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 23 '05 #2

P: n/a
In article <11**********************@g14g2000cwa.googlegroups .com>,
jo*********@ceridian.com enlightened us with...
In the application I'm developing, I need a link to behave as a form
submit. I set up a little test example below and it worked fine:


A form is not a valid child element of TABLE or TR.
Validate your HTML.
The form should either enclose the table, or the form should be enclosed in
the TD. Nest your elements properly.
The html you posted is invalid and is not equivalent. The first example has
the form nested properly, but as a child of TR. The second is nested
improperly completely (missing <td>).

You're lucky the first one ever worked. Nice of MSIE to fix that for you.

<form>
<table>
<tr>
<td>
<a>link</a>
</td>
</tr>
</table>
</form>

OR

<table>
<tr>
<td>
<form>
<a>link</a>
</form>
</td>
</tr>
</table>

Pick one.

--
--
~kaeli~
A boiled egg in the morning is hard to beat.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.