473,385 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

javascript submit

I have a html which I cannot edit but can add javascript to.
The html has a submit button named submit and I want to add a javascript function where i call document.frm.submit();.

I get an error because there is a field named submit. Is there any work around for this?
Jul 17 '07 #1
3 1725
iam_clint
1,208 Expert 1GB
Expand|Select|Wrap|Line Numbers
  1. document.frm.submit.setAttribute("name", "something_else");
  2. document.fmr.submit();
  3.  
Jul 17 '07 #2
Expand|Select|Wrap|Line Numbers
  1. document.frm.submit.setAttribute("name", "something_else");
  2. document.fmr.submit();
  3.  
Thanks...but it doesnt work in IE 7. I still get error
"Object doesn't support this property or method"

Here is the code...

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script type="text/javascript">
function approval() {
//do some validations
document.sObjectForm.submit();
}

</script>
</head>
<body>
<form name="sObjectForm" method="post">
<input type="submit" name="submit" value="Save" class="button" >
<input type="button" value="approval" class="button" onclick="javascript:approval()">
</form>

<script type="text/javascript">
document.sObjectForm.submit.setAttribute("name", "zzz");
</script>

</body>
</html>
Jul 18 '07 #3
iam_clint
1,208 Expert 1GB
possibly try
Expand|Select|Wrap|Line Numbers
  1. document.getElementsByName("submit")[0].setAttribute("name", "zzz");
  2. document.getElementsByName("submit")[0].name = "zzz";
  3.  
Jul 18 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Xeon | last post by:
Ok, the subject seemed not PHP related, but it does, as the submitted form will be read/processed by PHP. I have this HTML code: <form method="post" action="foo.php"> <select name="blah"...
5
by: RavenMaster | last post by:
I have a javascript form field validation script that I have used many times with no problems. However, I just started using the script in a PHP application that uses trans-sid for session...
2
by: Margaret Werdermann | last post by:
Hi all: I'm having a nasty time with a particularly difficult piece of code and was hoping someone might be able to help me. I have a FormMail form that originally worked perfectly. Then, I...
4
by: javascript_noob12 | last post by:
Hi. I am trying to create a CGI script that will use Perl to read a text file to get a list of values, then turn that list into a menu on a website. The menu will be a form with a JavaScript...
6
by: Joop | last post by:
Hi all, I'm kinda new to JavaScript, but hey... I'm trying anyway! ;-) So, here's my problem : I've created a table in my document, presenting a list of items, one can 'select' by clicking...
4
by: Ike | last post by:
Oh I must be missing somethign so simple and stupid. I need to do a submit() via an href, which I do (succesfully) in JavaScript in many other pages with <a...
1
by: michael.friis | last post by:
Im currently trying to build a simple extension to a website allowing me ot have a list of users in a frame beside the actual site. Problem is the actual website uses javascript to update the...
10
by: ljlolel | last post by:
So.. I have a form that submits to an ASP.net site made in C-sharp. The ASP site is not mine, i do not have the server side code. When I submit from my form by pressing the Submit button, I get...
2
by: ljlolel | last post by:
I'm posting this again because I did not explain myself well the first time, so the problem was not being addressed. I made the following page (...
5
by: Rabel | last post by:
I am a flash designer so I dont know a whole lot about the javascript submit buttons (I may not even be describing it right sorry) but here is the code I am using. <IMG name="Checkout"...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.