Solved

Form Code under a Button - Newbie

Posted on 2004-09-30
6
181 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

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 50

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

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 …
Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

823 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