Link to home
Start Free TrialLog in
Avatar of sargento
sargento

asked on

Sorting form elements

If I pass form elements to a script and I want to sort specific ones based on the order of the hidden sort tag:

<input type="HIDDEN" name="sort" value="order:realName,address,address_,city,state,zip,...

How would I do this? The names in the sort are the names of selected hidden inputs I want to sort that were passed!
Avatar of Hamlet081299
Hamlet081299

Can you give some more details?

Do you mean that you want to output the values entered in the form according to the specified order?  Or are you trying to create a form with the inputs in that order?
Avatar of sargento

ASKER

I want to output the values according to the sort order.
ASKER CERTIFIED SOLUTION
Avatar of Hamlet081299
Hamlet081299

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
p.s. I dropped the "order:" from the start of the sort value.  I don't know if this is needed.  If it is then just strip it off before doing the explode().
That's exactly what Iwant! Thanks!