Solved

Form Code under a Button - Newbie

Posted on 2004-09-30
6
178 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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

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 49

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now