petrsev
10-11-2011, 01:47 PM
Hello all,
i'm starting to use Niceforms solving for the better appearance of my forms (http://www.emblematiq.com/lab/niceforms/help/)
In my page i have for example this form
<form action="<?echo $_SERVER["REQUEST_URI"]?>" method="post" class="niceform">
<label>order by:</label>
<select size="1" name="orderby" onchange="this.form.submit()">
<option value="name"> Vzestupně </option>
<option value="name1"> Sestupně </option>
</select>
<input type = "hidden" name = "akce4" value = "zmena_razeni_prodejci" />
</form>
I modified this form follows (how it descibed http://www.emblematiq.com/lab/niceforms/help/):
<form action="<?echo $_SERVER["REQUEST_URI"]?>" method="post" class="niceform">
<label>order by:</label>
<select size="1" name="orderby" class="NFOnChange" >
el.lnk._onclick = el.onclick || function () {
if(this.ref.oldClassName == "NFOnChange") {
"this.form.submit()"
}};
<option value="name"> Vzestupně </option>
<option value="name1"> Sestupně </option>
</select>
<input type = "hidden" name = "akce4" value = "zmena_razeni_prodejci" />
</form>
Author Niceforms wrote about onchange:
By default, Niceforms overrides the onchange attributes of any drop down options, thus making a classic jump menu unusable. However, there is a quick workaround.
Add a custom class name to that particular select element (i.e. class="NFOnChange") so that the script can separate it from all the other regular select elements. Within the option(el, no) function, add the following code:
el.lnk._onclick = el.onclick || function () {
if(this.ref.oldClassName == "NFOnChange") {
//insert your code here
}};
Instead of the commented line simply insert your own custom javascript that should be executed when that particular option is selected.
but i dont know how it must be edited. I think that there is a syntax problem in "this.form.submit()". i dont know how i can change it.
Because now i have a beutiful form but when i try to change option it nothing happens.
Could somebody help me?
Im beginner in programming javascript.......thank you very much...Petr
i'm starting to use Niceforms solving for the better appearance of my forms (http://www.emblematiq.com/lab/niceforms/help/)
In my page i have for example this form
<form action="<?echo $_SERVER["REQUEST_URI"]?>" method="post" class="niceform">
<label>order by:</label>
<select size="1" name="orderby" onchange="this.form.submit()">
<option value="name"> Vzestupně </option>
<option value="name1"> Sestupně </option>
</select>
<input type = "hidden" name = "akce4" value = "zmena_razeni_prodejci" />
</form>
I modified this form follows (how it descibed http://www.emblematiq.com/lab/niceforms/help/):
<form action="<?echo $_SERVER["REQUEST_URI"]?>" method="post" class="niceform">
<label>order by:</label>
<select size="1" name="orderby" class="NFOnChange" >
el.lnk._onclick = el.onclick || function () {
if(this.ref.oldClassName == "NFOnChange") {
"this.form.submit()"
}};
<option value="name"> Vzestupně </option>
<option value="name1"> Sestupně </option>
</select>
<input type = "hidden" name = "akce4" value = "zmena_razeni_prodejci" />
</form>
Author Niceforms wrote about onchange:
By default, Niceforms overrides the onchange attributes of any drop down options, thus making a classic jump menu unusable. However, there is a quick workaround.
Add a custom class name to that particular select element (i.e. class="NFOnChange") so that the script can separate it from all the other regular select elements. Within the option(el, no) function, add the following code:
el.lnk._onclick = el.onclick || function () {
if(this.ref.oldClassName == "NFOnChange") {
//insert your code here
}};
Instead of the commented line simply insert your own custom javascript that should be executed when that particular option is selected.
but i dont know how it must be edited. I think that there is a syntax problem in "this.form.submit()". i dont know how i can change it.
Because now i have a beutiful form but when i try to change option it nothing happens.
Could somebody help me?
Im beginner in programming javascript.......thank you very much...Petr