[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

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


Closed Thread
 
LinkBack Thread Tools
Old 01-04-2007, 05:10 AM   #1 (permalink)
NamePros Regular
 
Rudy's Avatar
 
Join Date: Jul 2005
Location: United States
Posts: 588
613.72 NP$ (Donate)

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?

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 06:29 AM.
Rudy is offline  
Closed Thread


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 12:00 AM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85