473,379 Members | 1,511 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

test button to lookup mysql info and validate

Bob
I know how to use php/mysql, but the html aspect of
what Im trying to do (if its even possible this way) is what Im unsure
of.

I want to have a button that a user can hit to valid mysql info before
submitting the full page of info. I know this doesnt work, but
something like the following:

<form method=POST action="http://mysite.com/send.php">
<input type=text name=user>
<button>
<?php
.... do mysql lookup here and let user know 'user' is
valid....
?>
</button>
..... many more input types here ...
<input type=submit name="Submit">
</form>

Im unsure if A) it will work this way and B) how do even do this?

Will it work this way? If so what do I fill in in the button area?
Ive wondered if I need/should use javascript, but in looking around
the web it seemed that wouldnt work easily, or would it?
I know that the 'user' information is posted in the FORM, so Im unsure
how to get it into the php section anyhow.

Thanks for any help
Sep 15 '08 #1
2 2031
Bob wrote:
I know how to use php/mysql, but the html aspect of
what Im trying to do (if its even possible this way) is what Im unsure
of.

I want to have a button that a user can hit to valid mysql info before
submitting the full page of info. I know this doesnt work, but
something like the following:

<form method=POST action="http://mysite.com/send.php">
<input type=text name=user>
<button>
<?php
.... do mysql lookup here and let user know 'user' is
valid....
?>
</button>
.... many more input types here ...
<input type=submit name="Submit">
</form>

Im unsure if A) it will work this way and B) how do even do this?

Will it work this way? If so what do I fill in in the button area?
Ive wondered if I need/should use javascript, but in looking around
the web it seemed that wouldnt work easily, or would it?
I know that the 'user' information is posted in the FORM, so Im unsure
how to get it into the php section anyhow.

Thanks for any help
As this is an HTML question, not a PHP one, might I suggest a more
appropriate newsgroup - such as alt.html?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Sep 15 '08 #2
On 15 Sep, 18:31, Bob <j...@rahul.netwrote:
I know how to use php/mysql, but the html aspect of
what Im trying to do (if its even possible this way) is what Im unsure
of.

I want to have a button that a user can hit to valid mysql info before
submitting the full page of info. I know this doesnt work, but
something like the following:

<form method=POST action="http://mysite.com/send.php">
<input type=text name=user>
<button>
<?php
.... do mysql lookup here and let user know 'user' is
valid....
?>
</button>
.... many more input types here ...
<input type=submit name="Submit">
</form>

Im unsure if A) it will work this way and B) how do even do this?

Will it work this way? If so what do I fill in in the button area?
Ive wondered if I need/should use javascript, but in looking around
the web it seemed that wouldnt work easily, or would it?
I know that the 'user' information is posted in the FORM, so Im unsure
how to get it into the php section anyhow.

Thanks for any help
I suspect you're a bit confused about the relationship between what
happens serverside and what happens client side:

The server geenrates a page of HTML, then the client displays it.

There are ways to make things happen serverside without refreshing the
page - using Ajax or hidden iframes or tying code execution into other
operations triggered by javascript such as reloading an image.

I assume that you are presenting a form for the user to fill in, then
submitting it for some sort of validation prior to submitting it to be
saved.

While it is possible to do this (and its possible to code a static
javascript function which will work regardless of the specifics of the
form) a better solution would be just to use two submissions.

The key to working out the best method depends on knowing whether the
user will always be able to write the data in the final step.

C.
Sep 18 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Xizor | last post by:
Ok, I'm new to PHP and MySQL. I've been going through tutorials, reading the documentation, and looking through web sites. PHP to me seems great! With MySQL it seems even better. However, I'm an...
3
by: Mike Ho | last post by:
I'm wondering if there is a way to retrieve Foreign Key declaration information on both MyISAM and InnoDB tables. Of course, I understand that MyISAM doesn't support Foreign Keys, however, it...
15
by: lawrence | last post by:
Is this the correct way to test for a method before I use it? createRange() is, I believe, an IE only method. function wrapSelectionInTag(selection, tag) { if (document.selection.createRange)...
4
by: John Boy | last post by:
Hi, Can anyone help. This is really doing my nut in. 3 years ASP exp. and now doing .DOT which is a step in the wrong direction. Basically I am left with the code of a guy who has left. When I...
12
by: SJ | last post by:
Hope someone can help me out there I'm struggling with a particular problem... I have a form with many tab pages. On one tab page I've got a button which when clicked with a mouse adds items...
3
by: Patrick [MSFT] | last post by:
Let me preface this with the goal I'm trying to achieve is mimic a feature of another language (Dexterity used by Microsoft Dynamics) and so while a filling a drop down list is a workable solution...
2
by: emily224 | last post by:
Hello, I have been trying to understand this source code, which I retreived from my online course test. I would like to know how to find the answer for the question on the test. Im sure the answer...
4
by: emily224 | last post by:
Hello, I have been trying to understand this source code, which I retreived from my online course test. I would like to know how to find the answer for the question on the test. Im sure the answer...
3
by: Jeff | last post by:
I know how to use php/mysql, but the html aspect of what Im trying to do (if its even possible this way) is what Im unsure of. I want to have a button that a user can hit to valid mysql info...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.