/    Sign up×
Community /Pin to ProfileBookmark

Firefox problem

Problem is for some reason that my code works fine in IE but in firefox doesnt work. I am using php to generate the page.

<script type=”text/javascript”>

function callbutton22(){

post1.Submit23.click();

}

</script>

is the function im trying to call and this is coding below to call it.

this is the code where i set the call from

echo ‘ <input type=”radio” name=”group1″ onclick=”callbutton()”; value=”‘.$value.'”‘.$selected.’>’;

many thanks

Spooke2k

to post a comment
JavaScript

9 Comments(s)

Copy linkTweet thisAlerts:
@spooke2kauthorJul 30.2007 — sorry showed wrong bit of code its actually called in this

echo ' <input type="radio" name="group2" onclick="callbutton22()"; value="'.$value.'"'.$selected.'>';

and on a closer look it is calling the function but not working on post1.Submit23.click();

which acts as a submit click
Copy linkTweet thisAlerts:
@DokJul 30.2007 — If you want to submit a form use the submit() method not click()
Copy linkTweet thisAlerts:
@spooke2kauthorJul 30.2007 — That does not work in the function not even in ie

Sorry
Copy linkTweet thisAlerts:
@DokJul 30.2007 — You probably used it incorrectly. Show me the part of the code which contains the form you wish to submit.
Copy linkTweet thisAlerts:
@spooke2kauthorJul 30.2007 — <script type="text/javascript">

function callbutton(){

post1.submit_button.submit();


}

</script>

echo ' <input type="radio" name="group1" onclick="callbutton();" value="'.$value.'"'.$selected.'>';
Copy linkTweet thisAlerts:
@DokJul 30.2007 — The submit() method should be used on the form element - not the input element.
Copy linkTweet thisAlerts:
@spooke2kauthorJul 30.2007 — echo "<form name='post1' action='' method='GET'>";

Sorry to be pain but this is where the form action is set what do i need to add im not very good with javascript so sorry for dumb questions
Copy linkTweet thisAlerts:
@DokJul 30.2007 — Here is a small example
[code=html]<form id="myForm" method="post" action="server.php">
<input type="text" />
</form>[/code]

To submit this form use
[CODE]document.getElementById('myForm').submit();[/CODE]
Copy linkTweet thisAlerts:
@spooke2kauthorJul 30.2007 — thanks jjust what i needed
×

Success!

Help @spooke2k spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...