Jump to content

Designed button in dreamweaver, and then get value of button when clicked


xerox02

Recommended Posts

Is there a way I could get the value of a button I designed, and if I click the button it would be one value, and if it was not clicked it would be another . After that I can echo the checked values into a

I am trying to make it so, if I have a button I designed click, it would select a certain table in mysql.

Link to comment
Share on other sites

Sorry to rebump, but I researched my problem a little bit, and I am wondering if can getting values from a custom button without java script.  It seems that the only way to do it is with java script.  Is this true?

Link to comment
Share on other sites

This may sound like a silly question, but if you want it to function as a checkbox, why not just use a checkbox?

 

lol, well I guess it's a personally prefernce, but standard check boxes look kind of tacky. I do graphic design, so designing a button is convenient. All it is basically, you click it, and the button turns white, and then you click it again, and it turns black. After that, I want to get the value of the button, where it is white or black (checked or not checked) (clicked or not clicked, lol) .

Link to comment
Share on other sites

This may sound like a silly question, but if you want it to function as a checkbox, why not just use a checkbox?

 

lol, well I guess it's a personally prefernce, but standard check boxes look kind of tacky. I do graphic design, so designing a button is convenient. All it is basically, you click it, and the button turns white, and then you click it again, and it turns black. After that, I want to get the value of the button, where it is white or black (checked or not checked) (clicked or not clicked, lol) .

 

Hmm....I did something kind of like this using CSS. My nav bar....the link buttons when not clicked are one color and when clicked, they display an image.....is that kind of what you mean ?

Link to comment
Share on other sites

This may sound like a silly question, but if you want it to function as a checkbox, why not just use a checkbox?

 

lol, well I guess it's a personally prefernce, but standard check boxes look kind of tacky. I do graphic design, so designing a button is convenient. All it is basically, you click it, and the button turns white, and then you click it again, and it turns black. After that, I want to get the value of the button, where it is white or black (checked or not checked) (clicked or not clicked, lol) .

 

Hmm....I did something kind of like this using CSS. My nav bar....the link buttons when not clicked are one color and when clicked, they display an image.....is that kind of what you mean ?

 

yes, but after that want to have a value for the button when it is one color(when clicked) and another(when not clicked). I ll put that value in a variable. EXTRA STUFF:and based on that variable I will chose which table in mysql database to choose from.

Link to comment
Share on other sites

This may sound like a silly question, but if you want it to function as a checkbox, why not just use a checkbox?

 

lol, well I guess it's a personally prefernce, but standard check boxes look kind of tacky. I do graphic design, so designing a button is convenient. All it is basically, you click it, and the button turns white, and then you click it again, and it turns black. After that, I want to get the value of the button, where it is white or black (checked or not checked) (clicked or not clicked, lol) .

 

Hmm....I did something kind of like this using CSS. My nav bar....the link buttons when not clicked are one color and when clicked, they display an image.....is that kind of what you mean ?

 

yes, but after that want to have a value for the button when it is one color(when clicked) and another(when not clicked). I ll put that value in a variable. EXTRA STUFF:and based on that variable I will chose which table in mysql database to choose from.

 

It seems maybe this can only be done using jquery or javascript.

Link to comment
Share on other sites

You would need to use Javascript to store the state of the button within a hidden field. You can then read the value of that field once the form has been submitted.

 

If your not looking to submit a form (along with this button) then you'll need to use Javascript to make an Ajax request back to the server. Either way, your question has nothing to do with php or what editor you designed your button in.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.