close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Before page loads form =get

Thread began 2/16/2016 7:10 am by Kumel | Last modified 3/02/2016 4:00 pm by Ray Borduin | 464 views | 9 replies |

Kumel

Before page loads form =get

I have a page called notifications here all notifications are displaying thru db!
Notifications columns are: ID, UserId, SenderId, TimeAdded, UnRead & JobiD.

All values are added except unread = 0.
I want to turn this value to 1 as user clicks on the notification. As he clicks he is taken to a job details page about the notification & other details.

Now on details page i used link like this: ../job-details.php?JobID=213&NotificationID=5 (This means the person has clicked on notification which ID is 5 & JobID is 213 which currently is displaying details on JobID=213. As as person visits this page i have made a form in job-details.php page as :

<form name="notifications" action="job-details.php" method="post">
<input name="NotificationID" type="hidden" value="<?php echo((isset($_GET["NotificationID"]))?$_GET["NotificationID"]:"") ?>" />
</form>



I added update record server variable here using data assist As NotificationID as key value for table Notifications & setting trigger as before page loads & in binding choosing UnRead as 1 as value. But it doesnt work. But if a add a submit button & change trigger to on submit then it doesnt work.

How to make this work on Before page load?

Sign in to reply to this post

Ray BorduinWebAssist

I'd need to see the code. It is probably that you have the update record ID set to: <?php echo((isset($_POST["NotificationID"]))?$_POST["NotificationID"]:"") ?>

and it should be: <?php echo((isset($_GET["NotificationID"]))?$_GET["NotificationID"]:"") ?> in order to work before page load.

Sign in to reply to this post

Kumel

yeas Its GET itself. Anyways page attached.

Sign in to reply to this post

Ray BorduinWebAssist

I don't see any update code on this page at all. Set it up to update before page loads and then send me that page as you have set it up so I can debug what might be wrong.

Sign in to reply to this post

Kumel

there is update record just above the form

Sign in to reply to this post

Ray BorduinWebAssist

Just as I suggested you have the Key Column value set to:
<?php echo ((isset($_POST["NotificationID"]))?$_POST["NotificationID"]:""); ?>

and it needs to be:
<?php echo ((isset($_GET["NotificationID"]))?$_GET["NotificationID"]:""); ?>

Sign in to reply to this post

Kumel

it is : <input name="NotificationID" type="hidden" value="<?php echo((isset($_GET["NotificationID"]))?$_GET["NotificationID"]:"") ?>" />

Sign in to reply to this post

Kumel

oh grt. i thought your saying in text field. just changed on update record. thnks

Sign in to reply to this post

Kumel

@Ray. i added new RS. This is for updating time in db when it was read. This is as per Timezone from there end, this is stored in DB!

<input name="TIME" id="TIME" type="text" value="<?php date_default_timezone_set("".$row_CompanyDetails['TimeZone']."");echo "".date("Y-m-d G:i:s");?>">



So my form looks like this:

<form name="notifications" action="job-details.php" method="post" class="pull-right">

<input name="TIME" id="TIME" type="text" value="<?php date_default_timezone_set("".$row_CompanyDetails['TimeZone']."");echo "".date("Y-m-d G:i:s");?>">
<input name="NotificationID" type="hidden" value="<?php echo((isset($_GET["NotificationID"]))?$_GET["NotificationID"]:"") ?>" />
</form>



NotificationID is from URL. So then i went update record & added TIME as well..

But this doesn't upload the time into the server.

File attached. Input type may be text for now cause i was testing to see if time appears. & it does appear in page when i use type of input (TIME) as text.

Sign in to reply to this post

Ray BorduinWebAssist

You are using a trigger of "before page loads" but referring to a posted form value... the form post won't exist before the page loads because it won't have been posted.

If you want to set the value before the page loads you should be binding it directly to:
<?php echo (date("Y-m-d G:i:s"));?>

and you can add the line:
<?php date_default_timezone_set($row_CompanyDetails['TimeZone']); ?>

right above it on line 223

You can't refer to a form post in the before page loads triggered action because no form is being posted when the page loads.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...