Link to home
Start Free TrialLog in
Avatar of max7
max7

asked on

Firebug does not show value of hidden field?

Greetings,

Check this code out:

var socialProvider = $('#loginProvider').val();
  $('#social_icon').attr({
	src:'images/social_icons/'+socialProvider+'.png',
	alt: ''+socialProvider+''
	});
  $('#msggigyacomplete').css('margin-top','-25px');
  }

Open in new window


So I have a hidden field with the ID loginProvider that receives the name of a
social networking site using plugin.  Then, based on the name found in the value
loginProvider, it selects the appropriate image to appear in the ID social_icon.

It all works fine but I *thought* using firebug, I should see the name of the
social networking site appear in the value of loginProvider, but I did not.  To
verify it was working, I needed to alert the value of loginProvider instead.

Shouldn't firebug show the value attribute of the hidden field being populated?
Avatar of leakim971
leakim971
Flag of Guadeloupe image

why the bracket line 7?
Avatar of max7
max7

ASKER

>>>why the bracket line 7?

it's actually part of another function which I did not show since I didn't think it was necessary for the question but here is the entire block:

$('#msglogingygia1,#msglogingygia2,#loginDiv').hide();{
		 		$('#msggigyacomplete').show();
		 		$('#loginProvider').val(logingygia.loginprovider);
		 		var socialProvider = $('#loginProvider').val();
		 		//var socialIconImg ='images/social_icons/'+socialProvider+'.png';
		 		$('#social_icon').attr({
		 				src:'images/social_icons/'+socialProvider+'.png',
		 				alt: ''+socialProvider+''
		 		});
		 		$('#msggigyacomplete').css('margin-top', '-25px');
		 		}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of max7

ASKER

>>>Wrong javascript line 1 (the semicolon) : .hide();{

Thanks for pointing that out ... since the code runs ok with the semicolon, I assume jquery is slightly forgiving of some poor syntax?

So ... any ideas why firebug does not show the value attribute of the hidden field being populated?  Again, I know it the attribute is receiving the data since I can alert it.
You may havve an error (on Firefox) before reaching the alert statement
Avatar of max7

ASKER

>>>You may havve an error (on Firefox) before reaching the alert statement

hmmm, I'm not sure what that means.  what sort of error are you thinking of ?
>what sort of error are you thinking of ?

Do you see any error in the console? Do  you have public address to see your site?
Avatar of max7

ASKER

>>>Do you see any error in the console? Do  you have public address to see your site?

No errors at all and unfortunately the site is not live yet.

How about this: from what you know of firebug should it normally show the value attribute being populated or not?
with the javascript console yes of course
Avatar of max7

ASKER

Very odd ... I even corrected the error you pointed out in my code, thinking that might be preventing the value from populating but no dice. I don't know where to go from here.
Avatar of max7

ASKER

I stand corrected: I cleared my cache and checked again and sure enough, the value is populating now.  I have to assume that the syntax issue with my which you pointed out was preventing this from happening before.

Thanks!