Link to home
Start Free TrialLog in
Avatar of jdekeyrel
jdekeyrel

asked on

Form Code under a Button - Newbie

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,      
Avatar of alexhogan
alexhogan

<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>

Avatar of jdekeyrel

ASKER

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
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" > 
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>


ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That did it.    THANKS!! ryancys and alexhogan