fetch textbox value?

Get help using Construct 2

Post » Thu Mar 29, 2012 10:57 pm

I have 1 textbox and 1 button.
I have event that looks like this:

if message_button On Clicked: grab value of textbox and do something with it.

How do I do that?

Thanks.
I wish I could just script instead of using this event system.
B
3
Posts: 8
Reputation: 341

Post » Thu Mar 29, 2012 11:09 pm

I found out how to do it. message.value :P
B
3
Posts: 8
Reputation: 341

Post » Thu Mar 29, 2012 11:28 pm

It's actualy textbox.text
Textbox manual entry
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Fri Mar 30, 2012 12:46 am

oh ok. lol. I made a variable though so I used that haha. Anyway. how do I do an ajax POST request? I'm gonna try do a GET request like this. AJAX REQUEST:

"http://localhost/etheria/login.php?username=" + username.Text + "&password=" + password.Text

I have no idea if it'll work though lol :P
B
3
Posts: 8
Reputation: 341

Post » Fri Mar 30, 2012 12:58 am

Alright. I have a sql database. made a php login script (on localhost) basically I managed to log in successfully with localhost/etheria/login.php?username=test&password=test

How do I do this with construct?
I made 2 text inputs. username and password. then a button. button has on clicked event that sends the ajax request. then I have a Ajax event on completed ("login_attempt" tag) which sets login_output | set text to AJAX.LastData

But it's not working :P
B
3
Posts: 8
Reputation: 341

Post » Fri Mar 30, 2012 12:59 am

For a post request you would need the AJAX post or AJAX POSTer custom plugin.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Fri Mar 30, 2012 1:11 am

Well, I was doing GET request actaully and I can't get it to work.
B
3
Posts: 8
Reputation: 341

Post » Fri Mar 30, 2012 1:11 am

I can't get the AJAX.LastData
B
3
Posts: 8
Reputation: 341

Post » Fri Mar 30, 2012 1:15 am

Have you checked the AJAX examples in the how do I FAQ ?
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Fri Mar 30, 2012 1:21 am

no I've tried to find some. thanks!
B
3
Posts: 8
Reputation: 341

Next

Return to How do I....?

Who is online

Users browsing this forum: Rezzon71, tarek2 and 24 guests