Welcome Guest, Not a member yet? Register   Sign In
how to send data to controller without input form?
#1

[eluser]ws212[/eluser]
Let's say i have a form on the client side which have two input, first input named title, second input is content... i also give two button, first one is publish, second one is draft...

what i want to do is when client side click publish, there's additional boolean data named 'is_publish' with value = true or 1 is also being sent to the server, while if client side click draft, the 'is_publish' value will be 0 or false, but i don't want the client side to see this additional data on the client side form... is there an example/link on how to do this?
#2

[eluser]Aken[/eluser]
I'd suggest making the publish or draft a radio button option and having a single submit button. Better usability, less margin of error, and less PHP logic needed.

Typically you would give the submit buttons a name, and then check to see which was pushed and assign things accordingly, but there are some older browsers that don't support passing the values of submit buttons, so it has its downfalls. Another reason I'd recommend the above.
#3

[eluser]ws212[/eluser]
i think you're right... i might have been too influenced by the way blogger.com post their blog. Thank's for the advice...




Theme © iAndrew 2016 - Forum software by © MyBB