Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Form Code under a Button - Newbie

Posted on 2004-09-30
6
182 Views
Last Modified: 2010-04-25
I need the following code to be the action under a hotspot in a php page I've created with Fireworks.   I'm not quite sure how to get this done.  

<FORM action="https://sec.superbil.com/cgi-win/ccardmc.exe" method="POST" id="form1" name="form1">
<!-- Default Languge --->
<input type="hidden" id="language" name="language" value="1">
<INPUT type="HIDDEN" id="csubs" name="csubs" value="">
<INPUT type="HIDDEN" id="W9SUBS" name="W9SUBS" value="">
<INPUT type="HIDDEN" id="return" name="return" value="">
<INPUT type="HIDDEN" id="REVID" name="REVID" value="">
<INPUT type="submit" value="Secure Purchase" id="submit1" name="submit1">
</FORM>
            
Thanks in advance,      
0
Comment
Question by:jdekeyrel
  • 3
  • 2
6 Comments
 
LVL 8

Expert Comment

by:alexhogan
ID: 12194548
<SCRIPT language="JavaScript">
function submitform(){
  document.myform.submit();
}
</SCRIPT>


<FORM action="https://sec.superbil.com/cgi-win/ccardmc.exe" method="POST" id="form1" name="form1">
<!-- Default Languge --->
<input type="hidden" id="language" name="language" value="1">
<INPUT type="HIDDEN" id="csubs" name="csubs" value="">
<INPUT type="HIDDEN" id="W9SUBS" name="W9SUBS" value="">
<INPUT type="HIDDEN" id="return" name="return" value="">
<INPUT type="HIDDEN" id="REVID" name="REVID" value="">
<a href="javascript: submitform()">Click to Submit</A>
</form>

0
 

Author Comment

by:jdekeyrel
ID: 12196045
Sorry to be such a "simpleton" but I gotta ask....

Here's the code I put under the "hotspot":

  <map name="m_index_b">
 <area shape="poly" coords="356,129,372,151,447,151,439,134,414,136,405,128,356,129" a href="javascript:submitform()" target="_blank" alt="" > 
</map>


Put the rest of the code in the header.   Thanks
0
 
LVL 8

Expert Comment

by:alexhogan
ID: 12196535
Yes..,

The code between the <script> tags go in the header.

Remember to change the name of document.myform.submit()
to
document.form1.submit()
or whatever you have your form named.

Also change this;
<area shape="poly" coords="356,129,372,151,447,151,439,134,414,136,405,128,356,129" a href="javascript:submitform()" target="_blank" alt="" > 

to this;
<area shape="poly" coords="356,129,372,151,447,151,439,134,414,136,405,128,356,129" href="javascript:submitform()" target="_blank" alt="alternate text of graphic" > 
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

Author Comment

by:jdekeyrel
ID: 12196660
If works fine when I leave this line in:  

<a href="javascript: submitform()">Click to Submit</A>

The problem is I get a button at the bottom of the page.    

This line doesn't work:

 <area shape="poly" coords="356,129,372,151,447,151,439,134,414,136,405,128,356,129" href="javascript:submitform()" target="_blank" alt="alternate text of graphic" > 

Using FoxFire's JS Console -- I'm told submitform is not defined.  Yet on the same page the "extra" button works fine.  

I have some other javascript in the page:

<script type="text/javascript" src="/scripts.js">
</script>
<SCRIPT language="JavaScript">
function submitform(){
  document.form1.submit();
}
</SCRIPT>


0
 
LVL 51

Accepted Solution

by:
Ryan Chong earned 500 total points
ID: 12198285
try:

<area shape="poly" coords="356,129,372,151,447,151,439,134,414,136,405,128,356,129" href="" onclick="javascript:submitform();return false;" target="_blank" alt="alternate text of graphic" >

?
0
 

Author Comment

by:jdekeyrel
ID: 12199248
That did it.    THANKS!! ryancys and alexhogan
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
FINDNOCASE 2 560
Dreamweaver User Authentication Problem 13 703
Getting the co-ordinates of a map 1 189
Wrapping 2 Divs in a Container 8 569
For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question