PHP / Javascript question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi there everyone,

 

I have a form with check boxes and with PHP I use the array feature for the
form name.  Now I need to check if the tickboxes are ticked and if not
return an error, normally with javascript I would use:

 

<script language="JavaScript">

function validate_form ( )

{

    valid = true;

 

    if ( document.removeitems.del.value == "" )

    {

        alert ( "You cannot remove an item if it is not selected." );

        valid = false;

    }

            

    return valid;

}

</script>

 

BUT because the tickboxes information is stored in a PHP Array called del[]
I am having major problems getting it to work.  Does anyone know how to
determine with javascript if any boxes are ticked, when the name for the box
is an Array such as del[] ???  I’m grabbing the data from my MySQL DB
without a hitch etc …. And I know technically this is more MySQL / PHP list,
but it is related and I’ve looked online and can’t seem to find anything, so
thought I’d try here as usually you are all very helpful.

 

Thank you

 

Chris


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.795 / Virus Database: 539 - Release Date: 11/12/2004
 

[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux