close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

hidden field not populating column

Thread began 2/17/2012 11:49 am by asarcona308398 | Last modified 2/17/2012 5:00 pm by asarcona308398 | 1694 views | 7 replies |

asarcona308398

hidden field not populating column

i am using DA with a repeat selection from a recordset and the hidden field that DA creates: <input type="hidden" name="took_attendance_mihidden_<?php echo $RepeatSelectionCounter_2; ?>" id="took_attendance_mihidden_<?php echo $RepeatSelectionCounter_2; ?>" value="A" /> ---> it's value "P" is not being passed into the database column if the checkbox that it represents is not "checked".
the default value that DA associated with the hidden form was "1" and I changed it to "A" as it is an attendance form and who is present should be recorded as "P" and who is absent should be "A"
any help would be much appreciated

thanks,
tony

After looking into the database further I've discovered a greater problem..
The inserted rows is the first returned rowset from the query, repeated over and over.
I thought the query was at fault but ran it through Devart's Query Builder and it returned correct results...
I hope this is something that has been seen before

I've included an updated version of the file, attendance_2.zip is latest

thanks again,
tony

Attached Files
attendance.zip
attendance_2.zip
Sign in to reply to this post

Jason ByrnesWebAssist

the value of the checkbox will only be sent if the checbox is checked, this is the way a checkbox works, if it is not checked, no value is sent.

the checkbox is also used by the insert record behavior as a trigger for inserting that record, if not checked, no record for that column is created. I would recommend using a radio group instead of a checkbox.

the other issue is because you are using recordset data in the insert behavior, the recordsets are configured to filter using query string variables. When the page first loads, the querystring variables are passed in, but the forms action does not pass them when it sends the form data, so the recordsets are not filtering correctly on post.

change the form tag:

php:
<form  action="" method="POST" name="attend_date">




to:

php:
<form  action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?><?php echo (isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] != "")?"?".htmlspecialchars($_SERVER["QUERY_STRING"]):""?>" method="POST" name="attend_date">




this will include any existing querystring variables when the form is posted.

Sign in to reply to this post

asarcona308398

form is set to "post"....
checkboxes will be either marked or not, if not marked the hidden form value is supposed to stay in effect, as I understand a checked checkbox that "Post" should override the hidden input form field value.
Also --- the form gets into the database, the issue of the previous hidden form values that are skipped over is the problem, the record is entered, but the column is not populated for the hidden form field value,
and lastly... the first record values are repeated in the database for as many rows are inputed

thanks,
tony

Sign in to reply to this post

asarcona308398

I'm not sure a radio is possible as many entries are required...

I'll add the querystring variables and hope that solves the repeating data rows problem, thanks so much for looking at this

thanks,
tony

Sign in to reply to this post

asarcona308398

hey Jason,
very frustrating....
changed the action attribute, and the inserts were the same, repeated the first value and the hidden form field attribute did not post to database column...

Sign in to reply to this post

Jason ByrnesWebAssist

the checkbox does not override the hidden element. Either the checkbox is checked and has a value or it is blank and does not have a value.

this is why i suggested using a radio group, this way you have one radio button for "A" and another radio button for "P"



the insert will not loop through the recordset data.


you need a form field for each recordset column set the form field to use the recodset info, and bind the insert to the corresponding form element instead of binding to the rs column.

Sign in to reply to this post

asarcona308398

Jason,
added the visible form fields as well as the variables to the form action, and all is well, thanks a million...
I'm just wondering why hidden form fields will not work instead of having to show back end data to users... when I use hidden form fields bound to the recordset I get NULL entries in the database columns for those form fields and all the rest are populated correctly??

thanks,
tony

Sign in to reply to this post

asarcona308398

found the problem with the hidden fields.. selecting them from the form fields in the dynamic lightning bolt dialog box does not permit them to work as the don't seem to be inserted in the behavior as a "repeating" field as it labels itself after being chosen... choosing the hidden fields from the drop down box lists them as repeating fields and the insert multiple record behavior works.
I hope you guys document this as it can be re-created at will and is very difficult to find.

thanks for the great support and attention,
tony

Sign in to reply to this post

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...