Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 461
  • Last Modified:

Submit buttons not working

I am replacing button images with simple buttons to make things easier. Using classic ASP

This is an image that works as a button, when clicked it submits a form with certain parameters:

       <input name="imageField" type="image" onClick="document.form1.action='Emailforms.asp?caseid=<%=(Casesjoin.Fields.Item("Id").Value)%>'" src="../../../Images/Buttons/BtEmailForms.gif" width="84" height="20" border="0">

The above works great, form is submitted, I am replacing with a form button with the same action, but the form button doesnt work, is there something wrong in the syntax ?

 <input name="imageField" type="button" class="bodytext" id="imageField" onClick="document.form1.action='Emailforms.asp?caseid=<%=(Casesjoin.Fields.Item("Id").Value)%>'" value="    Email Forms    ">
0
Aleks
Asked:
Aleks
1 Solution
 
jmdl1983Commented:
you are changing the action value of the form, but not telling it to submit.

<input name="imageField" type="button" class="bodytext" id="imageField" onClick="document.form1.action='Emailforms.asp?caseid=<%=(Casesjoin.Fields.Item("Id").Value)%>'" value="    Email Forms    ">

Open in new window


should become

 
<input type="button" name="imageField" id="imageField" class="bodytext" onClick="document.form1.action='Emailforms.asp?caseid=<%=(Casesjoin.Fields.Item("Id").Value)%>';document.form1.submit();" value="    Email Forms    ">

Open in new window

0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now