Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
php/mysql cant seem to make this into a button
Old 09-15-2008, 11:11 PM php/mysql cant seem to make this into a button
Novice Talker

Posts: 5
Trades: 0
Im looked everywhere and maybe someone knows how.

Im trying to make this into a working Button becasue the script i have im hiding links

i have it like
Code:
if($this1 < $nume) { 
print "<a href='$page_name?start=$next'> <font face='Verdana' size='3'><button><b>Next</b></button></font> </a>";}
else {
But i wanted to hide links so i have this in
Code:
A:visited {
display:none;
}
but becasue it has "<a href= it counts it as a link and hide it as well.

I tryed makeing it into a Full button like
Code:
<button onClick="window.location='URL" style="color:#FFFFFF;background: url('/graphics/nav.gif'); width: 101px;">TEXT</button>
it does not work so if anyone know anything i can do about this be great thanks.

Last edited by dev0; 09-15-2008 at 11:12 PM..
dev0 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-16-2008, 03:37 AM Re: php/mysql cant seem to make this into a button
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
What is this ???
There are no <button> elements in html...
Honestly, you should revise your HTML bases...

Button are part of a form. To have a button somewhere, you must first declare the form, and then add inputs of type button it it.

HTML Code:
<form ...>
  <input type="button".../>
</form>
And just to help you further, I will let you search what should be put in place of ...
Your first stop should be http://www.w3schools.com
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 09-16-2008, 04:39 AM Re: php/mysql cant seem to make this into a button
abhi's Avatar
Super Talker

Posts: 100
Name: abhishek
Location: mauritius
Trades: 0
I don't understand what you are trying to do. Be more clear and with your code also.
__________________

Please login or register to view this content. Registration is FREE
Visit Mauritius Island for your holidays!
Please login or register to view this content. Registration is FREE
abhi is offline
Reply With Quote
View Public Profile Visit abhi's homepage!
 
Old 09-16-2008, 04:40 AM Re: php/mysql cant seem to make this into a button
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
There is you know button

That one got me yesterday as well and I had to look it up, 'cos I thought they were inventing elements and wondering why it didn't work.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 09-16-2008, 04:49 AM Re: php/mysql cant seem to make this into a button
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Quote:
Originally Posted by chrishirst View Post
There is you know button

That one got me yesterday as well and I had to look it up, 'cos I thought they were inventing elements and wondering why it didn't work.
Okay... You learn something new every day.
I'll try to remember it, but not sure. The input type=button is engraved somewhere in my brain so vividly, than surely it'll stay my first go.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 09-16-2008, 08:55 AM Re: php/mysql cant seem to make this into a button
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
<button>? I didn't know that one either. Geeze, that is bad, I'm supposed to be a front-end pro... I guess I'll give up, and go back to making cupcakes at the cupcake factory.

***EDIT***
I was reading up on this a bit more, and apparently you can place regular HTML you like inside of a button. This, for example, is perfectly valid:
HTML Code:
<button type="button">
    <ul>
        <li>Hello</li>
        <li>World</li>
    </ul>
</button>
The above will validate, as long as the button is contained by a block-level element such as a <p> or a <div>.
__________________
Join me on
Please login or register to view this content. Registration is FREE

Last edited by wayfarer07; 09-16-2008 at 09:08 AM..
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 09-16-2008, 05:04 PM Re: php/mysql cant seem to make this into a button
Novice Talker

Posts: 5
Trades: 0
Hi thanks for the msg's back but im not trying to make a norm button.

This right here is a turn page function

PHP Code:
if($this1 $nume) { 
print 
"<a href='$page_name?start=$next'> <font face='Verdana' size='3'><b>Next</b></font> </a>";}
else { 
once clicked it will pull more info from the DB and display it.

But what im doing is once the info is up and displayed i have it so once u click on it it's hides

Display none for the img's but i also want the same thing to happin for the links.

but because the turn page function is a link when i enable the links to hide once clicked the turn page function link it hides. now to try to get around this i need to make it into a button.

but once putting a button funtion into.

PHP Code:
if($this1 $nume) { 
print 
"<button onClick="window.location="$page_name?start=$next'" style="color:#FFFFFF;background: url('/graphics/nav.gif'); width: 101px;">Next</button>";}
else { 
i get errors.. So hoply that is more clear for you and you understand what i am trying to do better.

Thanks.
dev0 is offline
Reply With Quote
View Public Profile
 
Old 09-17-2008, 01:36 PM Re: php/mysql cant seem to make this into a button
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
PHP Code:
print "<button onClick="window.location="$page_name?start=$next'" style="color:#FFFFFF;background: url('/graphics/nav.gif'); width: 101px;">Next</button>";} 
is invalid, because you fail to backslash your quotes, like this:
PHP Code:
print "<button onClick=\"window.location=\"$page_name?start=$next\" style=\"color:#FFFFFF;background: url('/graphics/nav.gif'); width: 101px;\">Next</button>";} 
__________________
Join me on
Please login or register to view this content. Registration is FREE
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 09-25-2008, 10:02 AM Re: php/mysql cant seem to make this into a button
Novice Talker

Posts: 5
Trades: 0
i tryed this but and it displayed fine but the action didnt work.
dev0 is offline
Reply With Quote
View Public Profile
 
Old 09-26-2008, 06:36 PM Re: php/mysql cant seem to make this into a button
Novice Talker

Posts: 7
Name: Lubo
Trades: 0
Why don't you try assigning a css id/class to the links for the button and simply override the "display:none" of the default links?!
__________________

Please login or register to view this content. Registration is FREE
lub07 is offline
Reply With Quote
View Public Profile Visit lub07's homepage!
 
Old 09-27-2008, 11:36 PM Re: php/mysql cant seem to make this into a button
DigitaLink's Avatar
Average Talker

Posts: 16
Name: Chris
Trades: 0
The problem (I believe) is that a <button> will just create a push button - something that can trigger an onClick in javascript instead of using a hyperlink.

In order to make that button DO anything, you need to create it as a form submit button, that will POST your data back to the server, where your script can query the next batch of data from the db and move the user along.

Why would you want to do this via javascript, when it's an incredibly basic function of form data interacting with PHP? Perhaps in the case of an AJAX call to refresh data without reloading the page, but in that case, the onClick should call a javascript function that makes the xmlHttp request to the server and replaces the content of your div with the paginated data.

I don't believe (personally, and I could be wrong) that you will EVER get that button to do anything the way it is coded there. It isn't submitting any data to the server to run your script and return the new data.
DigitaLink is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to php/mysql cant seem to make this into a button
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.44007 seconds with 12 queries