Accurax Posted December 23, 2008 Share Posted December 23, 2008 Hi guys, Been a while since ive written much php... and i think this may be a dense question ... but.. i cant seem to make a javascript onclick event fire when its echo'd out inside a php statement.. see below: echo "<form method='post' action='" . $self . "'>"; echo "<input type=radio name='radio' value='" . $row['pres_title'] . "' onchange='this.form.submit()'>"; echo "</form>"; this works when its just in an html page... but i cant for the life of me seem to make it fire as is shown above ... can anyone shed any light on this please? thanks in advance Accy Quote Link to comment https://forums.phpfreaks.com/topic/138188-solved-i-think-im-being-dense-can-someone-have-a-look/ Share on other sites More sharing options...
Mark Baker Posted December 23, 2008 Share Posted December 23, 2008 echo "<input type=radio name='radio' value='" . $row['pres_title'] . "' onClick='this.form.submit();'>"; Works OK with onClick, which is what you say is a problem.... but you're actually trying to trigger an onChange event in your code Quote Link to comment https://forums.phpfreaks.com/topic/138188-solved-i-think-im-being-dense-can-someone-have-a-look/#findComment-722450 Share on other sites More sharing options...
Maq Posted December 23, 2008 Share Posted December 23, 2008 JS is case-sensitive, try onChange. Quote Link to comment https://forums.phpfreaks.com/topic/138188-solved-i-think-im-being-dense-can-someone-have-a-look/#findComment-722471 Share on other sites More sharing options...
Accurax Posted December 23, 2008 Author Share Posted December 23, 2008 lol... its ok i was being a muppet .... must be this cold ive got ... im about to post a thread to do with the "real" issue here... this however is solved in itself... thanks for those who took the time to look hmmm cant seem to see the "mark as solved" option Quote Link to comment https://forums.phpfreaks.com/topic/138188-solved-i-think-im-being-dense-can-someone-have-a-look/#findComment-722473 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.