|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
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
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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.
|
|
#3
|
|||
|
|||
|
RE: JScript with PHP
Well I want it to check each time a row is added or submitted. What would you recommend?
|
|
#4
|
|||
|
|||
|
RE: JScript with PHP
Server side, with PHP, before it hits the database. That way, javascript cant be circumvented by turning it off.
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > JScript with PHP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|