473,394 Members | 1,722 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,394 software developers and data experts.

Submit working only in FF

Hi!

Firstly I have to tell that my english isn't perfect, so forgive me for
that.

Second: I have little problem with this code:

<a href="javascript:;" title="Edit"
onclick="document.formularz.edited_param_id.value= '0';document.formularz.submit()">Edit&nbsp;&laquo; </a>

It's working fine only in Firefox 0.9, but why not in IE or Opera ?
Where is the bug ?

--
Regards, Caesar.
================================
Jul 23 '05 #1
3 1139
Lee
Cezar said:

Hi!

Firstly I have to tell that my english isn't perfect, so forgive me for
that.

Second: I have little problem with this code:

<a href="javascript:;" title="Edit"
onclick="document.formularz.edited_param_id.value ='0';document.formularz.submit()">Edit&nbsp;&laquo ;</a>

You're telling the browser to do two different things at the same time:
1. submit the form
2. follow the link in the HREF attribute, and so stay on the same page.

If you don't want to follow the link in the HREF attribute, you
should always return false from the onclick handler.

Jul 23 '05 #2
Lee napisał(a):
You're telling the browser to do two different things at the same time:
1. submit the form
2. follow the link in the HREF attribute, and so stay on the same page.

If you don't want to follow the link in the HREF attribute, you
should always return false from the onclick handler.


You right! Now working fine.

Thank You.

--
Regards, Cezar.
================================
Internet Explorer? Powinni tego zabronić.... :-P
" ..posiada moduł telepatyczny.." - przyszłe opcje przegl±darek
Jul 23 '05 #3
In article <ci**********@atlantis.news.tpi.pl>,
Cezar <ce*****@imail.net.pl> wrote:

<a href="javascript:;" title="Edit"
onclick="document.formularz.edited_param_id.value= '0';document.formularz.submi
t()">Edit&nbsp;&laquo;</a>

You are using a link to submit a form. While I have not seen the web
page, it is best to be consistent as possible. Links are for
navigation. Buttons are used to submit forums.

Here is an example of validating a forum then submitting the form.

Robert

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Check a form field</title>

<script type="text/javascript">

function validate(x)
{
var submitOK = true;
var messageText =
"What a suprise! Please correct the error in your ways." +
" Please remove the asterisk ( * ) in the name field.";

if (x.elements["theName"].value.indexOf("*") >= 0)
{
alert(messageText);
submitOK = false;
}

return submitOK;
}

</script>
</head>
<body>
<p>
This html file shows how to cancel a submit.
To cancel the submit, place an asterisk ( * ) in the name field.
</p>
<form name="myForm"
action="http://www.natAValidWebAddress.com"
method="POST"
onsubmit="return validate(document.forms['myForm']);">
<p>Name:<br>
<input type="text" name="theName" size="20"></p><br><br>
<input type="submit" value="Please submit">
</form>
</body>
</html>
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Bruce Duncan | last post by:
I can't seem to figure our why this doesn't work. I don't get any errors, it just doesn't submit. Can anyone shed some light. <?PHP $var1 = "http://localhost/php/index.php"; $varx = "bruce";...
17
by: Dave Smithz | last post by:
Hi there, A PHP application I built has a section which lists a number of members to a club whose names each appear with a check box beside them that can be ticked. These check boxes are part...
15
by: Mattia | last post by:
Hi! I have a <form> that can be submitted thruogh three buttons and I need to tell witch one was pressed when the form was submitted. I now do it with 3 <input type="submit" name="..."...
6
by: Peter Lauri | last post by:
Best groupmember, I am working on a login form that uses md5 as cryptation. I have got everything to work exept the submit() function. I have verified that all rows work except the last on: ...
10
by: Perry van Kuppeveld | last post by:
Hi, I have a problem with formatting a table including text fields wich can contain up to 255 chars. I need a table with 3 columns: - First column 50 % over the with a rowspan of the total...
7
by: amerar | last post by:
Hi All, I am really green at Javascript. Someone gave me some code to play with and I'm trying to understand it: <INPUT TYPE=text NAME=subject SIZE=60 MAXLENGTH=60><BR><BR> <input...
13
by: deko | last post by:
I have a basic feedback form with a submit button. After the "send" button is clicked, I want the user to be redirected to a different page that says "Your message has been sent." How do I do...
4
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all I have the following code: I am trying to use the value of the image button to evaluate what plan the user has chosen, i.e. it request("submit1")="Basic", then the user chose basic plan...
1
by: mrsquash | last post by:
Hello all, I'm quite stumped here. I have multiple forms that collect user data. Once the form has been completed, the user saves the data. On my save screen are links for the user to select...
3
by: kavithadevan | last post by:
Hi, Here i have pasted 2 scripts first one is design and next one is country.php in the below code is working nicely. ----------------------design.php------ <form name="form1" method="post"...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.