Re: Getting values into a form: PHP (Server) or Javascript (Client) Side?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: Getting values into a form: PHP (Server) or Javascript (Client) Side?

From: Good Man <heyho@letsgo.com>
Date: Fri Mar 03 2006 - 17:13:04 CET

"J.O. Aho" <user@example.net> wrote in
news:46r7pkFchn19U1@individual.net:

> I don't really see the point in using javascript at all in this case,
> you get a more difficulty to figure out bugs.
>
> if you use
>
> <input type="text" id="firstName" value="<?= $first_name ?>" />
> <input type="text" id="secondtName" value="<?= $second_name ?>" />
> <input type="text" id="lastName" value="<?= $last_name ?>" />
>
> You either have a value set of the variables $first_name,
> $second_name, $last_name and so on (I know, I added the two last
> ones).
>
> If a value isn't set, then the box will be empty and it's just to add
> the values manually.

The only point would be saving me programming time. On a page with 50+
form-fields, I can save lot of time by writing a PHP loop that writes an
HTML call to a javscript function instead of going to each form field and
entering the value="<?= $first_name ?>" stuff...
Received on Mon May 1 02:26:34 2006