![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| ||||||
| ||||||
|
|
You have named your submit button "submit", so your reference above is to the button, not the submit method of the form. Remove the button's name or change it. |
|
bgcolor and background are both depreciated, use the equivalent style properties, preferably in a css style element. |
|
SCRIPT language="JavaScript" type="text/javascript" The language attribute is depreciated, remove it. Keep the type attribute, it is required. |
|
<!-- Hide script from old browsers |
|
Subverting an A element this way is bad. -snip- a href="whyThisDidntWork.html" onclick="submitForm();" ...>...</a |
|
The purpose of the link seems completely unnecessary. Why not call submitForm() from the form's onsubmit event? |
#2
| ||||||||
| ||||||||
|
|
RobG wrote: [...] bgcolor and background are both depreciated, use the equivalent style properties, preferably in a css style element. - as with the above, <body> would do fine for me until the day it is no longer supported. I can't say i'm a fan of CSS and most of what I want to develop doesn't need it. |
| SCRIPT language="JavaScript" type="text/javascript" The language attribute is depreciated, remove it. Keep the type attribute, it is required. I'll take your advice here. But is there any particular reason for this? |
|
I notice most of the free JavaScripts include the opening tags like this. Most probably because either the authors couldn't be bothered to fix |
|
<!-- Hide script from old browsers - They also (a lot of them) include a bit which ignores the script. Was there any traditional reason for this before? |
| Subverting an A element this way is bad. -snip- a href="whyThisDidntWork.html" onclick="submitForm();" ...>...</a Oops. Actually what I used was: a href=\"javascript: void(0);\" onclick=\"submitForm();return false;\" But out of desperation when things didn't work I started playing around with some changes, and must have used the wrong source code in my posting. |
|
Is javascript: void(0) acceptable? Or you would still suggest a real link? Making the link without going running the function is as good as not running it at all... so i'm not sure it would make a difference for compatibility reasons. |
|
The purpose of the link seems completely unnecessary. Why not call submitForm() from the form's onsubmit event? I need to run SubmitForm() becuase I want to add a hidden form variable to the form before I submit it. The standard form submit button I have (which would submit without this variable) achieves something else when the resulting PHP page is loaded. Is there a better way to do this though? |
|
What I really need then is for two different ways to submit the form, but one with an extra variable attached. Also I would prefer to use a link since it looks nicer in my page. |
#3
| |||
| |||
|
|
RobG wrote: [...] <!-- Hide script from old browsers - They also (a lot of them) include a bit which ignores the script. Was there any traditional reason for this before? |
#4
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |