• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Coding with Firefox: Alternative for "onclick"?

madmatt

Bow Down to the King
Political User
#1
I'll admit, I am the typical Microsoft guy who doesn't bother with Firefox. I received an email from a client today with a problem that their online job application is not coming through. I decided to install Firefox on a virtual OS and see if it had something to do with the way Firefox handles the code.

I didn't find a problem with the initial application but with the next step in the process.

I am using a text link with the "onclick" property.

PHP:
<a href="#" class="menulink" onClick="submit();">Click here to take the affirmative action online survey.</a>
I know there is a problem because Firefox does not support "onclick". Weird.

I got tired of researching it so decided to ask. Thank you.
 

albybum

Penguin Rancher
#2
no caps, try onclick rather than onClick

Also, you may need to be specific about the form being submitted.

Alternatively, you can embed javascript in the href attribute.

Like,
Code:
<a href="javascript:document.getElementById('frmGoogleSearch').submit();">Google Search!</a>
 
Last edited:
#3
as albybum said its most likely to be the attribute case. if you want to try it in firefox with a javascript console then download firebug as well for firefox
 

madmatt

Bow Down to the King
Political User
#4
I'm not making any progress.

PHP:
<form method="POST" name="aasurvey" action="index.php?show=careers&sub=aasurvey">

  <input type="hidden" name="position" value="<?php print $_POST['position']; ?>">
  <input type="hidden" name="date" value="<?php print date('m/d/Y'); ?>">
  <input type="hidden" name="howDid" value="<?php print $_POST['howDid']; ?>">
  <input type="hidden" name="firstName" value="<?php print $_POST['firstName']; ?>">
  <input type="hidden" name="middleName" value="<?php print $_POST['middleName']; ?>">
  <input type="hidden" name="lastName" value="<?php print $_POST['lastName']; ?>">
  <input type="hidden" name="address" value="<?php print $_POST['address']; ?>">
  <input type="hidden" name="address2" value="<?php print $_POST['address2']; ?>">
  <input type="hidden" name="city" value="<?php print $_POST['city']; ?>">
  <input type="hidden" name="state" value="<?php print $_POST['state']; ?>">
  <input type="hidden" name="zipCode" value="<?php print $_POST['zipCode']; ?>">
  <input type="hidden" name="country" value="<?php print $_POST['country']; ?>">
  <input type="hidden" name="phoneNumber1" value="<?php print $_POST['phoneNumber1']; ?>">
  <input type="hidden" name="phoneNumber2" value="<?php print $_POST['phoneNumber2']; ?>">
  <input type="hidden" name="ssn" value="<?php print $_POST['ssn']; ?>">
  <input type="hidden" name="emailAddress1" value="<?php print $_POST['emailAddress1']; ?>">
  <input type="hidden" name="emailAddress2" value="<?php print $_POST['emailAddress2']; ?>">

  In an effort to comply with requirements regarding government recordkeeping, reporting, and other legal obligations which may apply, we invite you to complete the <a href="javascript:void(0);" class="menulink" onClick="submit();">affirmative action online survey</a>.  Providing this information is <b>STICTLY VOLUNTARY</b>.  Failure to provide it will not subject you to any adverse personnel decision or action.<br>

  &nbsp;<br>

  <a href="javascript:document.getElementById('aasurvey').submit();" class="menulink">Click here to take the affirmative action online survey.</a>

</form>
See final a href.

First, I changed "onClick" to "onclick". No difference.

Next, I changed it to the statement that alby suggested. No difference.

Next, I installed Firebug and it's not telling me there is anything wrong.

Furthmore, the statement alby gave me works perfectly with IE6 and IE7.
 
Last edited:

albybum

Penguin Rancher
#8
This also works.

Code:
<a href="#" class="menulink" onclick="document.aasurvey.submit();">Click here to take the affirmative action online survey.</a>
 

X-Istence

*
Political User
#9
This also works.

Code:
<a href="#" class="menulink" onclick="document.aasurvey.submit();">Click here to take the affirmative action online survey.</a>
It won't properly on certain browsers. Since some browsers won't populate the document namespace with all the "id" attributes. Konqueror being a prime example, neither does Safari.
 

Members online

No members online now.

Latest posts

Latest profile posts

Hello, is there anybody in there? Just nod if you can hear me ...
Xie
What a long strange trip it's been. =)

Forum statistics

Threads
61,961
Messages
673,239
Members
89,014
Latest member
sanoravies