-
1. Re: Receiving INPUT TEXT, making Forms from scratch.
EnthusiastOfTheMind May 10, 2013 5:10 AM (in response to Departure)Hi I'm fairly new to Edge, but I've managed to send data from input fields using the append/ajax method...
//append input box to <div> in another symbol...
//I have made a symbol called "contact_screen" on stage and this contains my input boxes (rectangle <div> called "InputEmail)
var InputEmail = sym.getSymbol("contact_screen").$("InputEmail");
//append the input field to your box. Note value is called to get the text content later
$("<input type='text' value='' id='InputEmaili' size='80'>").appendTo(InputEmail);
//set any css you want to the input field
sym.getSymbol("contact_screen").$("#InputEmaili").css({"height":"29", "width":"492px", "font-family":"Annie Use Your Telescope, cursive", "font-size":"24px"});
// do the same for your other input fields
//then apply to a button click function
var comp = sym.getComposition().getStage().getSymbol("contact_screen");
//gets the values
var name = comp.$("#InputNamei").attr("value");
var email = comp.$("#InputEmaili").attr("value");
var message = comp.$("#InputMessagei").attr("value");
//sets the values as "data"
var data = "name="+name+"&email="+email+"&message=" + message;
$.ajax({
type: "POST",
url: "email/contact.php",
//gets the data values
data: data,
success: function(phpReturnResult){
alert('Thank you.'+'\r\n'+'Your message has been sent successfully!');
//this resets the values after sent
comp.$("#InputNamei").val("");
comp.$("#InputEmaili").val("");
comp.$("#InputMessagei").val("Your message has been sent.");
sym.$("feedbackTxt").text("");
},
error: function(errormessage) {
alert('Sorry message failed to send: ' + errormessage);
}
});
-
2. Re: Receiving INPUT TEXT, making Forms from scratch.
EnthusiastOfTheMind May 10, 2013 5:24 AM (in response to EnthusiastOfTheMind)I believe you have to append a <input type='text'> to a <div> whether its a rectangle or a text box. Its html .
-
3. Re: Receiving INPUT TEXT, making Forms from scratch.
EnthusiastOfTheMind Jan 27, 2014 8:59 AM (in response to EnthusiastOfTheMind)The newer versions of Edge Animate (v2+, v3) doesn't seem to support some of the old syntax I've put up here, setting the value of an input text field needs changing from .attr("value") to .val() i.e....
var name = comp.$("#InputNamei").attr("value");
to
var name = comp.$("#InputNamei").val();

