Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

javascript in button that works in firefox but not in internet explorer

Posted on 2012-03-22
3
Medium Priority
?
275 Views
Last Modified: 2012-04-04
Can anyone tell me why this code is working fine in Firefox but not in Internet Explorer? I need to be able to send a form to two different target pages in function if the users click on standard submit button or another button that changes the action of the form:


<form id="edit_Content" name="edit_Content" action="boto.asp" method="post">
<input name="name" type="text" />
somewhere in your form, you have a button:
<input type="button" value="Save" onclick="document.edit_Content.action='boto.asp';document.edit_Content.target = 'blank';document.edit_Content.submit();" />

</form>

Open in new window

0
Comment
Question by:starbase2
[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 Comments
 
LVL 54

Assisted Solution

by:Scott Fell, EE MVE
Scott Fell,  EE MVE earned 668 total points
ID: 37751622
Why don't you just post the form to your asp page and use your server side scripting to post the data to the 2nd page?
0
 
LVL 13

Assisted Solution

by:ansudhindra
ansudhindra earned 664 total points
ID: 37751669
try this...

<script>
function doPost(){
document.edit_Content.action='boto.asp';
document.edit_Content.target = '_blank';
document.edit_Content.submit();
}
</script>

<form id="edit_Content" name="edit_Content" action="boto.asp" method="post">
<input name="name" type="text" />
somewhere in your form, you have a button:
<input type="button" value="Save" onclick="javascript:doPost()" />
</form>

Open in new window

0
 
LVL 9

Accepted Solution

by:
experts1 earned 668 total points
ID: 37752247
Try mod <input> button properties as below:

<input type="button" value="Save" onclick="document.edit_Content.setAttribute('action', 'boto.asp');document.edit_Content.setAttribute('target', 'blank');document.edit_Content.submit();" />

Open in new window

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

636 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