Hi,
both the option list and the width/height are on your input form, right? Then you don't need to use the code section, but the js tab. You have to set an event to the option list, so when changed, it will fill the other fields if C is selected. This can be achieved using the 'javascript events-executed on loaded page' section. Assuming your option list is named 'optfield', and the width field is named 'width', the js code will be like this:
//everytime the option changes
CB("input").change(function(){
//get the value selected
var selected=CB("#optfield").find(":selected").attr("mv_option");
//if selected VALUE is 'C'
if(selected=="C"){
//fill the width field with 25
CB("input").val(25);
}
});
Hope this helps, regards
Hi,
it is not work, so:
optfield - is name or variable of option list?
fldname='width' - is name or variable?
Thank you.
//everytime the option changes
CB("input").change(function(){
//get the value selected
var selected=CB("#optfield").find(":selected").attr("mv_option");
//if selected VALUE is 'C'
if(selected=="C"){
//fill the width field with 25
CB("input").val(25);
}
});
Hi,
you should always use the variable names in order to handle your fields, both at the script and at the code section.
optfield and width are the variable names of your option list/numeric fields at your form.
Hope this helps,regards
Ok, I tried it, but no effect. And other when I set inline result - it still loading result and nothing to view. Maybe some problem with template? Thank you?
Hi,
if the inline result is not comming back (not even empty), is usually due to any sintax error at the code section. We suggest to comment out your js and/or main code and try to add lines progressively in order to locate the origin of the issue. Same for js, if there is any previous error, the js will stop execution, so maybe your code is not even reached.
Hope this helps, regards
Hi, inline now is ok, but when I write this to javascript Executed on load page:
CB("input").change(function(){
var selected=CB("#material").find(":selected").attr("mv_option");
if(selected=="Papír"){
CB("input").val(25);
}
});
inline not work.
Material - is name of variable of option list
Papír - is one of three value in option list
num2 - is name of varialbe of width
Is it ok?
And last question. When I send email from php, czech diacritics is bad. Any idea?
Thank you.
Edited by moon_1350 - 02.12.2013 21:32
Edited by moon_1350 - 02.12.2013 23:02
Hi,
that code has a right sintax, maybe you have any other section on your page named 'material'? Try this instead for the first line:
//changed input for select
CB("select").change(function(){
About mail characters, when locale characters are missing is usually due to an encoding issue. Depending on the method you're using to send email, you can set the headers to specify any special encoding/charset,(utf-8 should work) to ensure they will be printed. If you use standard mail funcion you can find the information about setting headers here:
http://php.net/manual/en/function.mail.php
or if using joomla jmail you can use the charset variable:
http://doc.joomladev.eu/api25/Joomla-Platform/Mail/JMail.html
Hope this helps, regards
I tried everything. Can I export my calc a can I send to you, please? Thank you.
Hi,
code debugging is far beyond our support, but we don't mind to take a look at your page to check if it shows any script error. Share your url here or at a helpdesk ticket (with the code included) and we'll let you know if we can point out where could be the issue.
Regards
Thank you very much. You are great.
Hi, I need help. I have a form. In first row I have a option list (A,B,C). In second I have a number line (width) and in third a number line too (height). If I choose A or B set width and height my own size. But If I choose C I would like to set width and height automatically to for example: 25. If I set to code in joomla administration: if ($type_name = "C")
$width = 1; ->it doesn´t work. Do you have any idea? Thank you.
Edited by moon_1350 - 26.11.2013 21:11