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

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

General Form Question

Thread began 4/11/2014 11:55 am by Art | Last modified 4/11/2014 2:34 pm by Jason Byrnes | 418 views | 11 replies |

Art

General Form Question

I know I'm going to feel really stupid after asking this...here it goes.

I have a form. It's very simple and it uses <button type"submit"...

It's used to send user to the search page. When I enter text and click the enter key, it work (sends to page and populates the GET). If I actually click the "SEARCH" button, it fails.

If I use input type="submit", it works both ways. What is tripping me up here?

<form action="searchpage.php" method="GET">
<input type="text" name="name" id="sprodtxt">
<button type="submit">SEARCH</button>
</form>

<!--<input type="submit" name="Search" id="Search" value="Search" alt="Search" />-->

Sign in to reply to this post

Jason ByrnesWebAssist

What browser are you using?

IE is notorious for not passing button values.

on the searchpage.php, use the name text filed to trigger the search instead of using the button as the trigger:
<input type="text" name="name" id="sprodtxt">

Sign in to reply to this post

Art

Firefox and I've checked others and they do the same. I've validated the content and that checks out.

Sign in to reply to this post

Art

I created another page and put the form on that page and it works. Could a conflict with another form be causing this?
Could sending to "self" be causing it?

Sign in to reply to this post

Jason ByrnesWebAssist

like I said previously though, don't use the button as a trigger in behaviors, use the text field instead.

button behaviors are not standard across all browsers, so they should not be relied ion as triggers, you cannot rely on the button being included with the other form data

Sign in to reply to this post

Art

Do you mean don't use this? <button type="submit">SEARCH</button>

Sign in to reply to this post

Jason ByrnesWebAssist

no, i mean that on the searchpage.php page, yoou will have behaivors that use the button as a trigger:

something like:

if(isset($_GET['SEARCH'])) {

use the text box as the trigger instead:

if(isset($_GET['name'])) {


also, the button should have a name and value attribute:
<button type="submit" name="SEARCH" value="SEARCH">SEARCH</button>

Sign in to reply to this post

Art

$_GET['name'] is what I'm using to pull in results to the recordset on the searchpage.php

Could this fail because I use "post" in two other forms on the searchpage.php.

Sign in to reply to this post

Art

I found the problem. it was a jQuery AutoComplete script that was messing with it.

Sign in to reply to this post

Jason ByrnesWebAssist

ok, glad to hear you found the problem.

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