Hidden Control's value is not showing in javascript on MAC Safari

A

aquimr

Hi,

I'm using input hidden control's value in the javascript function.

same code is working fine on all other browser except a specific
version of safari(i.e.: MAC OS 10.3.7 and Safari 1.2.4).

problem:
control's value is not getting displaying at the first time
when the page gets load, although the same piece of code would work if
I just refresh the page, strage.

declaration of hidden control:
<INPUT id="hSliders" type="hidden" runat="server">

javascript code which is calling the value of hSliders:

alert(document.Form1.hSliders.value)

this alert is showing nothing although it should display string.

i check the view source also control's value is getting populated.

Any help would greatly appriciated.

Thanks,
Aquim
 
M

Martin Honnen

declaration of hidden control:
<INPUT id="hSliders" type="hidden" runat="server">

That seems to be ASP.NET stuff and not HTML but with HTML an <input>
element should have a name attribute e.g.
<input type="hidden" name="inputName1">
and then with even old browsers you can access
document.forms.yourFormName.elements.inputName1.value

Other than that I don't know what could be wrong but it does not help
much here if you show server-side code, in particular for an environment
like ASP.NET which might generate different markup for different browsers.
If you still have problems then post the HTML Safari gets, show us the
HTML markup of the relevant HTML <form> and the relevant <input>.

Of course if your claim that it does not work with "MAC OS 10.3.7 and
Safari 1.2.4" means you have tested with other Safari versions and there
it works then it could also be a bug in Safari. But using a name
attribute could help work around that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top