MyBB Community Forums

Full Version: Form Design Question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I always think why MyBB includes all those "Go" buttons for form designs (like, say 'language select') when the function is called through:

onchange="functionName();"

Is there any specific reason behind this?
In case Javascript is disabled?
So, what if I just wrap the {$gobutton} in an id

<span id="goBut">{$gobutton}</span>

and hide it through jQuery:

<script type="text/javascript">jQuery('#goBut').hide();</script>

So, if javascript is disabled the onChange will not work and at the same time the button hide function will not occur.
Is it right to do? Maintaining good coding standard / practice?
I'm not one to talk about coding standards, as I've probably broken several rules.

But that should work.
(2013-01-27, 08:03 AM)effone Wrote: [ -> ]So, what if I just wrap the {$gobutton} in an id

<span id="goBut">{$gobutton}</span>

and hide it through jQuery:

<script type="text/javascript">jQuery('#goBut').hide();</script>

So, if javascript is disabled the onChange will not work and at the same time the button hide function will not occur.
Is it right to do? Maintaining good coding standard / practice?

The way it's done already is much simpler, and requires less markup.
Alright, thanks Josh and Eric for clarifications Big Grin
<script type="text/javascript">jQuery('#goBut').hide();</script>

in this code, if javascript is disabled the onChange will not work...
(2013-02-01, 06:27 AM)confused76 Wrote: [ -> ]<script type="text/javascript">jQuery('#goBut').hide();</script>

in this code, if javascript is disabled the onChange will not work...

http://community.mybb.com/thread-133571-...#pid966931

^^^ R-E-A-D ^^^

By the way, what is javascript? I'm confused 76 times.
(2013-02-01, 04:48 PM)effone Wrote: [ -> ]By the way, what is javascript? I'm confused 76 times.

JavaScript is client-side PHP. JQuery is written in JavaScript.