Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old December 6th, 2004, 06:32 PM
lmayer lmayer is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: USA
Posts: 225 lmayer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
JScript with PHP

Hi all,

I found a thread here that came very close to whay I am looking for but I don't have the syntax quite right.

This is the script validation that I found:

<script>
function check()
{

for(var i=0;i<5;i++)
{

if(document.form1('['rowdata']+i['Location']').value=="")
{
alert("Enter a value");
document.form1('['rowdata']+i['Location']').focus();
return;
}
}
}
</script>

My form fields are a bit strange because of the way I had too write the array. The form field looks like this:
<?
$LocationName= "rowdata[$cnt][Location]";
?>
<input name=<? echo $LocationName ?> type="text" value="<? echo $arrRowData[$cnt]['Location']; ?>" size="5" onClick="check()">

Problem is it doesn't work. No errors just never checks. I am almost positive it has to be the field name. But I can't seem to get the syntax just so.

Any help would be greatly appreciated.

Thanks

Laura

Reply With Quote
  #2  
Old December 6th, 2004, 06:34 PM
nawlej nawlej is offline
Contributing User
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Dallas, Tx. USA
Posts: 2,008 nawlej User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 7 m 51 sec
Reputation Power: 4
RE: JScript with PHP

did you get it to invoke it during onSubmit() for the form? I think the problem lies in the fact that you are doing an on click with a text field, which generally isnt used for onClick events, I dont think.

Reply With Quote
  #3  
Old December 6th, 2004, 06:38 PM
lmayer lmayer is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: USA
Posts: 225 lmayer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: JScript with PHP

Well I want it to check each time a row is added or submitted. What would you recommend?

Reply With Quote
  #4  
Old December 6th, 2004, 06:48 PM
nawlej nawlej is offline
Contributing User
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Dallas, Tx. USA
Posts: 2,008 nawlej User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 7 m 51 sec
Reputation Power: 4
RE: JScript with PHP

Server side, with PHP, before it hits the database. That way, javascript cant be circumvented by turning it off.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > JScript with PHP


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 | 
  
 





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