close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

How to add new form elements to an existing Results page inDataAssist

Thread begun 6/28/2016 1:51 pm by tmcbinc99963 | Last modified 7/01/2016 2:33 pm by Ray Borduin | 7340 views | 10 replies |

tmcbinc99963

How to add new form elements to an existing Results page inDataAssist

I'm trying to add a select list and multiple checkboxes inside an existing Results Page Search form. The results form won't recognize any of the search criteria. Returns all results no matter what is selected or entered in the form.

Sign in to reply to this post

Ray BorduinWebAssist

You should avoid using the column name 'date' and any other reserved words as listed here: https://dev.mysql.com/doc/refman/5.5/en/keywords.html

Your select list for date is named "select", but your code is referencing the field as "date".... They have to match, so line:

$WADbSearch1->addComparisonFromList("date","date","AND","=",0);


should be:

$WADbSearch1->addComparisonFromList("date","select","AND","=",0);



or you need to update the select name to "date" to match the php code.

Your checkbox names are "CheckboxGroup1". If you want your users to be able to select more than one, they would have to be named: "CheckboxGroup1[]". If they can only select one then you should be using radio buttons instead.

and then you have a similar issue with the column name reference for that search as well. This code:

$WADbSearch1->addComparisonFromCheck("category","category","".$row_WADAnews['category']  ."","","AND","=","=",0);


should be:

$WADbSearch1->addComparisonFromList("category","CheckboxGroup1","AND","=",0);



Groups of checkboxes act just like multi-select lists.

Sign in to reply to this post
Did this help? Tips are appreciated...

tmcbinc99963

The column names have been changed and the comparison values have been fixed using the DataAssist Search server behavior and Dynamic List/Menu.

I get the following error message when trying to view page in browser:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= (news_category LIKE '%AND%') LIMIT 0, 10' at line 1

This pops up when trying to edit the Dynamic List/Menu server behavior. None of the changes are applied when these errors pop up:

ERROR in TagEdit.setOuterHTML
Cannot parse the following value for newOuterHTML:
<option<select name="select" id="select" <>php if (!(sctrcmp("",ucwords($row_news_select['news_date'])))) {echo "selected=\"selected\"";]?>>
<option
While executing applyServerBehavior in DynamicSelectList.htm, a JavaScript error occurred.

File attached.

Sign in to reply to this post

Ray BorduinWebAssist

Line 17 has:

$WADbSearch1->addComparisonFromCheck("news_category","Checkgroup1","".$row_WADAnews['category']  ."","","AND","=","=",0);


It should be:

$WADbSearch1->addComparisonFromList("news_category","Checkgroup1","AND","=",0);


The error in the dynamic select is because your html is out of sync. Your first option tag isn't closed. You have:

php:
<select name="news_select" id="news_select">

     <option value="value" <?php if (!(strcmp("value"ucwords($row_news_select['date'])))) {echo "selected=\"selected\"";} ?>               
     <option value="">Select Size</option>
                <option value=""></option>
<?php
do {  
?>
     <option value="<?php echo $row_news_select['date']?>"<?php if (!(strcmp($row_news_select['date'], ucwords($row_news_select['date'])))) {echo "selected=\"selected\"";} ?>><?php echo $row_news_select['date']?></option>
     <?php
} while ($row_news_select mysql_fetch_assoc($news_select));
  
$rows mysql_num_rows($news_select);
  if(
$rows 0) {
      
mysql_data_seek($news_select0);
      
$row_news_select mysql_fetch_assoc($news_select);
  }
?>
   </select>



I think it should just be:

php:
<select name="news_select" id="news_select">           

     <option value="">Select Size</option>
<?php
do {  
?>
     <option value="<?php echo $row_news_select['date']?>" ><?php echo $row_news_select['date']?></option>
     <?php
} while ($row_news_select mysql_fetch_assoc($news_select));
  
$rows mysql_num_rows($news_select);
  if(
$rows 0) {
      
mysql_data_seek($news_select0);
      
$row_news_select mysql_fetch_assoc($news_select);
  }
?>
   </select>
Sign in to reply to this post
Did this help? Tips are appreciated...

tmcbinc99963

Decided to go with static select menu, so the Dynamic List/Menu server behavior is deleted.

Still getting the following Mysql error message on page view:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= (news_category LIKE '%AND%') LIMIT 0, 10' at line 1

File attached.

Sign in to reply to this post

Ray BorduinWebAssist

Did you close and open your browser after making the page updates? The bad search may have been saved in the session.

To debug further I'd need to debug the page directly. Do you have a url where I can see the problem and FTP access?

Sign in to reply to this post
Did this help? Tips are appreciated...

tmcbinc99963

Closing and reopening browser got rid of sql error message.

Multiple problems with Search:

When select list comparison value was "itemchecked" it didn't work, but checkboxes did (all checkboxes are <name="CheckboxGroup1" id="CheckboxGroup1">

When select list comparison value was changed to name of select list (news_select) the drop down worked, but not the checkboxes (no results found)

Checkboxes have never worked as a group.

Textfield search has never worked at all (no results found or all results from table).

Viewing page on remote server shows an odd 'table doesn't exist' message.

FTP credentials are in private message and file attached.

Lastly, DW crashes repeatedly when accessing the Search Wizard. The only solution I've found is to edit one item at a time, closing Wizard after each edit.

Sign in to reply to this post

Ray BorduinWebAssist

Your live database only has the columns:
contsize, prod, prodsize, prodtype

There is no table named news.

When using a checkbox group the comparison only has to appear once in the list, but you should name all of your checkboxes with brackets as I explained in post 2.

You should have: name="CheckboxGroup1[]"

I've updated your page, but you will have to update the database so that the table exists before it will work on the live server.

Sign in to reply to this post
Did this help? Tips are appreciated...

tmcbinc99963

Which file did you fix? It still works as before, even after the Db update.

Sign in to reply to this post

Ray BorduinWebAssist

Try again... you had "Select a Year" as your value for the default option... it needs to be value="" to be ignored. I've updated that as well now.

Sign in to reply to this post
Did this help? Tips are appreciated...
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...