By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,723 Members | 1,876 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,723 IT Pros & Developers. It's quick & easy.

test button to lookup mysql info and validate

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.