URL: http://www.uburst.com/cgi-bin/dcforum/dcboard.cgi
Forum: uReserve_general
Thread Number: 21
[ Go back to previous page ]

Original Message
"Required Field"

Posted by Amy [amy.steinbacher@dgs.state.md.us] on at 06:58 AM
I need to make the phone number field required. Could you tell me which part of the code I need to modify?

Thanks for your help!

Table of contents

Messages in this discussion
"RE: Required Field"
Posted by Bill Weiner on at 04:02 AM
Assuming that you have the "phone" field configured as the reserve field "2" on the reservation form (the default), here are some instructions on how to make the phone field required:

STEP 1: Make a backup of your ureserve.pl script... just in case.

STEP 2: Open your ureserve.pl script with any text editor such as WordPad.

STEP 3: Do a search on the following line:

if ($res_start_time >= $res_end_time)

(There will be exactly TWO occurances of that line in the script.)

(Hopefully the greater-than sign appeared correctly in the above line. This forum sometimes has trouble displaying greater-than and less-than signs.)

STEP 4: Just BEFORE BOTH of the occurances of that line, add the following 4 lines:

if (($reserve_field2 =~ /\S/) && (!($res_field2 =~ /\S/)))
&missing_input("Missing Input","Please enter $reserve_field2.");

STEP 5: After adding those 4 lines to BOTH places in the script... save the script... as TEXT if your editor asks... and try it out!

"Modification Didn't work"
Posted by Amy [amy.steinbacher@dgs.state.md.us] on at 01:54 PM
I tried to insert the 4 lines of code you suggested, but it didn't work. The phone number is still not a required field. Any suggestions?

Thanks for your help.

"RE: Modification Didn't work"
Posted by Bill Weiner on at 04:45 AM
I just tried the modifications out myself on a test script here and they worked fine.

Did you remember to put the 4 lines of code in BOTH places in the script?

Double-check that, if you are still having a problem, then send us a support request at http://www.uburst.com/supportform.html ... and I'll make the change for you.

Posted by Amy [amy.steinbacher@dgs.state.md.us] on at 09:42 AM
I'm sorry. I just tried to modify the script again, and this time it worked. I must have been sleeping when I tried it last week. Thanks a lot for your help!