?
Solved

Form Code under a Button - Newbie

Posted on 2004-09-30
6
Medium Priority
?
185 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
[X]
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
  • 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
On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

 

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 53

Accepted Solution

by:
Ryan Chong earned 2000 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

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…
I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month8 days, 20 hours left to enroll

764 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