473,407 Members | 2,320 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,407 software developers and data experts.

submit from on click from hyper link

Guys,

I am calling onclick="document.form.submit();" in a hyper clink.

On click, it goes to a fuseaction where act_load_structure.cfm loads the structure with form variable.

But the form fields are not avaibale in act_load_structure.cfm . It says form fields are not defined. Do you know why.

I appreciate your help in advance
Mar 27 '08 #1
8 6118
I think you have specified the cfm path in the href attribute of the link.
Remove that!!! Then it should work.

Hussain


Guys,

I am calling onclick="document.form.submit();" in a hyper clink.

On click, it goes to a fuseaction where act_load_structure.cfm loads the structure with form variable.

But the form fields are not avaibale in act_load_structure.cfm . It says form fields are not defined. Do you know why.

I appreciate your help in advance
Mar 27 '08 #2
I think you have specified the cfm path in the href attribute of the link.
Remove that!!! Then it should work.

Hussain

here is by href. what do i need to remove.

<a href="#Attributes.TemplateURL#?CurrentPage=#Count# #Attributes.AddedPath#" onclick="document.form.submit();">

with this, it is going to the correct fuse action but the form variables are not available.
Mar 27 '08 #3
acoder
16,027 Expert Mod 8TB
Show the form code. What is the method of submitting, GET or POST? Are you retrieving the form values as GET (url.formvar) or POST (form.formvar)?
Mar 27 '08 #4
Show the form code. What is the method of submitting, GET or POST? Are you retrieving the form values as GET (url.formvar) or POST (form.formvar)?

Here is the dsp page


Expand|Select|Wrap|Line Numbers
  1. <cfoutput>
  2. <cfform name="form" id="form" action="index.cfm" method="post">
  3. <table>
  4.     <tr>
  5.         <td>
  6.             <input type="text" name="log" value="#attributes.log#" />
  7.             <input type="text" name="AcctId" value="#attributes.AcctId#" />        
  8.             <input type="text" name="tablename" value="test" />                    
  9.         </td>
  10.     </tr>
  11. </table>
  12. <table width="100%">
  13. <tr>
  14. <td align="left">
  15.     <a href="index.cfm?fuseaction=#XFA.test#&amp;log=#attributes.log#&amp;AcctId=#attributes.AcctId#&amp;rn=#attributes.rn#" onclick="document.form.submit();">test</a>
  16. </td>
  17. </tr>
  18. </table> 
  19. </div>
  20. </cfform>
  21. </cfoutput>
  22.  
Here is the destination page

<cfoutput> tablename = #form.tablename#</cfoutput>
<cfabort>

or

<cfoutput> tablename = #tablename#</cfoutput>
<cfabort>


I appreaciate your help
Mar 27 '08 #5
acoder
16,027 Expert Mod 8TB
Make the link into a submit button and/or move the href into the action attribute of the form. At the moment, it's posting to just "index.cfm".
Mar 31 '08 #6
Try this code,it should work.


Expand|Select|Wrap|Line Numbers
  1.      <cfoutput>
  2.  
  3.       <cfform name="form" id="form" action="index.cfm?fuseaction=#XFA.test#&log=#attributes.lo  g#&AcctId=#attributes.AcctId#&rn=#attributes.rn#" method="post">
  4.  
  5.       <table>
  6.  
  7.           <tr>
  8.  
  9.               <td>
  10.  
  11.                   <input type="text" name="log" value="#attributes.log#" />
  12.  
  13.                   <input type="text" name="AcctId" value="#attributes.AcctId#" />  
  14.  
  15.                   <input type="text" name="tablename" value="test" />             
  16.               </td>
  17.           </tr>
  18.        </table>
  19.        <table width="100%">
  20.        <tr>
  21.       <td align="left">
  22.           <a href="##" onclick="document.form.submit();">test</a>
  23.       </td>
  24.       </tr>
  25.       </table>
  26.       </div>
  27.        </cfform>
  28.        </cfoutput>
  29.  
Hussain
Apr 7 '08 #7
acoder
16,027 Expert Mod 8TB
That should work about right.

To the OP: you're passing the attributes.log/AcctId values in the URL and the form values of the same name will also be posted. Is this necessary? Thought I'd just point out.
Apr 8 '08 #8
Absolutely not required.
I just copied-pasted the url param into the Form's action tag without looking into the copied stuff. :D
Apr 8 '08 #9

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

Similar topics

1
by: Stanimir Stamenkov | last post by:
Here's an example: <form action="bogus" method="post"> <p> <a href="prev.cgi"><input type="submit" name="prev" value="< Back"></a> <a href="next.cgi"><input type="submit" name="next"...
4
by: jim | last post by:
I new with .net and asp. I can't find a way to link a asp page from a asp.net page. I have tried a button and even a simple hyper link is not working. When I click the hyper link in asp.net(in the...
7
by: bill | last post by:
Is there any way to make a link (as marked by an <A>-tag, that is), behave exactly like a submit button? Many thanks! -bill
2
by: Matt | last post by:
Can we click a link and it will submit the form to the other page? Usually we will submit the form to other page by clicking a submit button. Now I need to do the following, but what if I have...
2
by: Billy | last post by:
Hi. I'm new to asp.net and I'm trying to create a confirm dialog box using the confirm() javascript function that will pup once the submit button is pressed. My problem is when I call...
26
by: Mica Cooper | last post by:
Hi, I need to pass some info in a javascript submit. <a href="javascript:document.formName.submit();">Submit Form</a> Normally a link would do page.jsp?x1=1&x2=2&x3=3 and you would pull x1,...
1
by: doris1202004 | last post by:
I have divide three frames: 1 is the menu which show the choice a,b,c. on the left side this is a typer-link 2 is the body frame which show the img on the right frame 3 is the sentense frame...
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...
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
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...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.