Hi
I have value from function in client script
The problem is when i use hidden textbox value cant save to the table. It only work when my textbox is not hidden.
Can anyone help me?
Thank you for your help
Hi
I have value from function in client script
The problem is when i use hidden textbox value cant save to the table. It only work when my textbox is not hidden.
Can anyone help me?
Thank you for your help
Assume you use input type=“hidden” tag, how do you provide the value for the tag?
Thank you
in client script >> Table Specisif >> add/copy page
ew.vars.getLocation = function() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
} else {
alert(“Geolocation is not supported by this browser.”);
}
}
function showPosition(position) {
$(“#x_lati”).val( position.coords.latitude);
$(“#x_longi”).val(position.coords.longitude);
$(“#x_coor”).val($(“#x_lati”).value()+“,”+$(“#x_longi”).value());
}
if i set field lati, longi, and coor as hidden text box (visible=false) when i save to the table the field is blank
when i set field lati, longi, and coor as visible=true then i the field fill with that value
Thank you for your helps
nabilahasna wrote:
if i set field lati, longi, and coor as hidden text box (visible=false)
How did you set “visible=false”? If you use $this->field->Visible = FALSE, there is no code outputted in the page and there is no value submitted. You should use CSS to hide the row instead (put in HTML → Styles → User tab), e.g.
#r_lati {
display: none;
}
this HTML → Styles → User tab is working thank you so much
#r_lati, #r_longi {
display : none;
}
for other view/search form i want to show thats field… how to make this field showing? (i mean how to change thats css style on the fly) ?
thank you for your help
You may use jQuery to set css, see: https://api.jquery.com/css/.
arbei wrote:
You may use jQuery to set css, see: https://api.jquery.com/css/.
Thank you arbei
i have try css on the fly like this
client scripts → table specific → search page
$(“#x_lati”).css( “display”, “true” );
but nothing happens… can you gave me a hint?
Thank you for your help
If you just want to show/hide the element, use $(“”).show() / .hide()
Thank you so much.