Get ready for BLACK FRIDAY shopping starting in

Forums

This topic is locked

prompt user for date

Posted 31 Oct 2005 20:02:19
1
has voted
31 Oct 2005 20:02:19 jamie b posted:
hello again,

(dwmx04, php, mysql)

I have a Form called a 'jobcard' with many fields.
One of the fields is a Date field (date the job was done).

Then I also have a 'reports' (results) page that displays all the 'jobcards' (in a repeat region).

>> What i now need to do is this: When the 'manager' opens the 'reports' page, then I want to PROMPT him to input a [Date FROM] and a [Date TO], so that only the jobcards for the specified period is displayed.

Maybe some kind of a Filter ? But how do i force (prompt) the user to specify a START date and an END date.

Any ideas would be most welcome.

Thank you in advance.

Regards,
Jamie.

Replies

Replied 31 Oct 2005 20:22:25
31 Oct 2005 20:22:25 Dave Thomas replied:
you could always hide the data, or have the data on a different page ready to re-direct once the dates were entered.
so basically don't show them anything until they play ball <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

regards

Dave Thomas
<b>DMX Zone Manager</b>
Replied 31 Oct 2005 21:29:48
31 Oct 2005 21:29:48 jamie b replied:
you understand what i want to do but what i am asking is this:

i could make a form with 2 date fields (from/to)

then i have to 'pass' thos 2 fields to another (redirect) page where the data is displayed.
no problem with that, but does thios mean that i will need some sort of query for that page ?

what i am after is the 'programming' side of it.
ie, how do i tell the master page where to get the dates from ?

thanks for the reply anyway.

jamie.
Replied 02 Nov 2005 12:33:26
02 Nov 2005 12:33:26 Wayne Hultum replied:
Put this inside script tags on the page where the manager fills out the form to get the results.

function checkForm(){
error = "";

if (document.jobcard.FIELDNAME.value == "" {error = "Please enter a valid to date"}
if (document.jobcard.FIELDNAME.value == "" {error = "Please enter a valid from date"}
if (error == "" {
document.jobcard.submit()
} else {
alert(error)
}
}


form button

input type="button" onClick="checkForm()" value="Submit"


This will only allow the form to be submitted it the two fields are filled in

Hope it helps

Wayne

Edited by - wayne1000 on 02 Nov 2005 12:35:33
Replied 09 Nov 2005 19:46:40
09 Nov 2005 19:46:40 jamie b replied:
thanks for the reply but i still cannot resolve this issue...

i think my problem is more of a mysql query issue.

i can use the 'between' operator of mysql in a query for the jobcard page, but how do i tell the query to check against the dates that the user submits in the form as you stipulated above ?

the 'between' operator only allows me to enter the 'between' dates at the time of the query.

what i need is to insert the dates that the user submits into the query at the time the user requests the report.

any other ideas, please ?!

regards,
jamie

Reply to this topic