0

I'm putting together a VERY simple time tracking widget to embed into my companies homepage. It's going to be broken down by individual offices and I'm formatting it as a drop-down box with no more than ten employees in it and two buttons (clock-in and clock-out) the problem is that I'm not sure how to make this same field work with both of these buttons. Can anybody give me some guidance on how to format the form so that it can use either of the submit buttons?

2
Contributors
5
Replies
6
Views
8 Years
Discussion Span
Last Post by ShawnCplus
0

They don't have to be submit inputs, they can be button tags which set a field to say clockin or clockout and then submit the form though you could do exactly the same thing with submit inputs

0

The problem is that, in my experience in input forms, you have to designate which PHP component it will use in the "form action" field, but I'm using two different PHP actions.

Maybe there's a way to use the clock-in and clock-out buttons as a sort of "toggle" inside the php form rather than completely separate forms.

0

The problem is that, in my experience in input forms, you have to designate which PHP component it will use in the "form action" field, but I'm using two different PHP actions.

Maybe there's a way to use the clock-in and clock-out buttons as a sort of "toggle" inside the php form rather than completely separate forms.

If by action you mean file, don't do that. Really for something this simple this should only be one file in total (ie., the form posts to the page it exists on)

0

I think I know what I have to do, I'm just a little stuck on finding the code to do it. I think it needs to be something like this:
Clock-In button (submits, adds timestamp and "IN" tag
Drop down box for field data<
Clock-Out button (submits, adds timestamp and "out" tag

Is this the best solution? and how do I format the buttons to do this.

0

You don't need the button to add the timestamp, you can do that in PHP. All you need the buttons to do is the in or out.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.