SunQuest
 
           PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old April 29th, 2004, 08:33 AM
paulo paulo is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 1 paulo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Passing a PHP array variable to javascript

Hi

Hopefully one of you can help me, or even provide me with an alternate
solution.
I have the following problem

I've got this code inside a while loop

<td>
R<input class='cellinputred' type='text' size='8' maxlength='8' name='ActualAmount[". $DisplayData["{$type}_id"] ."]' disabled>
</td>

<td>
<input type='checkbox' name='DisplayID[]' value='". $DisplayData["{$type}_id"] ."' onclick='EnableDisable(\"". $DisplayData["{$type}_id"] ."\");'>
</td>


I'm trying to disable/enable the ActualAmount[] input, depending on whether the DisplayID[] checkbox is ticked or not.

Heres the java

<script language="JavaScript" type="text/javascript">

function EnableDisable(object) {
if(document.forms.BudgetForm.element["DisplayID[]"].checked) {
document.forms.BudgetForm.elements["" +object+ ""].disabled = true;
}
else {
document.forms.BudgetForm.elements["" +object+ ""].disabled = false
}
}

</script>

Forgive my lack of javascripy knowledge, i am working on it though


Thanks,
PaulO

Reply With Quote
  #2  
Old May 12th, 2004, 08:32 PM
mww mww is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 1 mww User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Try this

<head>
<script language="JavaScript">
function JS_Help(arg1)
{
alert(arg1);
}
</script>
</head>



<body>

<?
$Test = "Blah";
?>

<script language="JavaScript">
JS_Help("<?=$Test?>");
</script>

</body>

You can pass any values this way

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > Passing a PHP array variable to javascript


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway