NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page getElementById problems...

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 01-04-2007, 06:10 AM THREAD STARTER               #1 (permalink)
NamePros Regular
 
Rudy's Avatar
Join Date: Jul 2005
Location: United States
Posts: 586
Rudy is just really niceRudy is just really niceRudy is just really niceRudy is just really nice
 


Save a Life

[Resolved] getElementById problems...


Edit: This is Fixed

Hey guys,
I've got some php/javascript that I'm trying to use to update some content on a page.

Here's my php function which in turn echoes out the javascript functions I'm working with:
Code:
function Javascript_Function_ChangeSearchByUserOwner() {
echo "<script language=\"javascript\">
  function ChangeSearchByUserOwner(selectbox) {
	   var username = selectbox.options[selectbox.selectedIndex].value;
	   document.forms[0].SearchOwnerName.value = username;
	   document.getElementById('SearchOwnerName').innerHTML = 'Submitted by: ' + username;
  }
  function ChangeOwner(selectbox) {
		   var username = selectbox.options[selectbox.selectedIndex].value;
		   document.forms[0].ownerName.value = username;
		   document.getElementById('ownerName').innerHTML = 'Submitted by: ' + username;
  }
</script>";
}
Here's the code that I'm using that I want updated:
Code:
	  
<?PHP echo "<input type=hidden name=ownerName value='";
$ownerName = next($topdata);
echo $ownerName."'><span id=ownerName>Submitted by: ".$ownerName."</span>

// And Then later in the code....

<div style='width:300px;text-align:center'>
	<table width=100%>
	<tr>
	<td width=100%>
		<div style='float:left;width:130px;text-align:left'>
			<form name=usersearchform target=hiddenframe action=usersearch.php method=post>
		<input type=textbox size=20 name=search id=search> <input type=submit value="Search">
		 <br />
	 		<select name=userlist id=userlist size=8 width=50px> </select>
		</form>
		</div>
		<div style='float:right;width:130px;text-align:center;font-size:14px;color:white;background-color:#5577bb'>
				 <form name=holocaust>
				 <?PHP echo "<span id=SearchOwnerName>Submitted by: ".$ownerName."</span>";?>
				 </form>
		</div>
	</td>
	</tr>
	<tr>
	<td align="center">
		<input type=button value="Select User" onClick="ChangeSearchByUserOwner(document.usersearchform.userlist)"> <input type=button value="Close Window" onClick="HideDiv('usersearch')">
	</td>
	</tr>
</table>
</div>
Any ideas why the text is not being updated?
????: NamePros.com http://www.namepros.com/programming/276782-getelementbyid-problems.html

Thanks,
David

This is fixed now... I ended up using 1 function instead of two.
__________________
Smooth Stone Services
Affordable Web Hosting Solutions Starting at only $4.95/month, IT Consulting and Technical Support


Hunt Sources - Hunting Resources Online
Last edited by Rudy; 01-04-2007 at 07:29 AM.
Rudy is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 09:29 PM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger