Form submission

First, I forgot the link for the iFrame sample. Here it is, sorry. Also, scroll down it and press PAGE2 to see the demo: http://www.iframehtml.com/

Well, you would have to create a string with the data inside the textfields.
Then, build the actual ?..&…&… string to use in calling the PHP code. Here is one sample…
Since the code you posted calls a function “update()”, you would access that data. Something like:

function update(){
var updateinfo=“updatepage.php?id=’” + document.getElementById(‘id’).value + “,&qty=’” + document.getElementById(‘qty’).value + “’,&price=’” + document.getElementById(‘price’).value + “’”;
document.getElementById(‘iFrame1’).src=updateinfo;
}

*** NOTE: this sample loads an iFrame with a new page. If you want to just pass it to another page, you would use Javascripts Windows.redirect command. Also, watch out for the quote/Double-quote issue. This is a very critical part of building a string to pass on. I usually pop-up an ALERT to display it to make sure it is correct before making the code live. Check out the results of your string build to make sure it is correct. ***

Hope this helps…

I have everything working. the only problem I am having is the previously posted code. could you help me with this?

Please refresh my memory, can you post the code where you are having problems. I need the calling part where you need to add the extra options. I think you are close, but, need to see the new changes in place or at least a little of it… Thanks…

not quite sure which code you are looking for…this is the function though…

[code][/code]

I specifically need this line to be able to have multiple ?s…idk what you call em…anyways like .php?id=1&product=2, etc.

xmlhttp.open("GET","update1.php?q="+str"&price="+document.getElementById.price,true);

I need the values to come from this form though

[code]

Quantity $
<input type="button" name="submit" value="update" onclick="update()" />
[/code]

any help?

Well, I am not experienced with XMLhttpRequest’s, but, it looks like this is your error…
Change:
xmlhttp.open(“GET”,“update1.php?q=”+str"&price="+document.getElementById.price,true);
with:
xmlhttp.open(“GET”,“update1.php?q=”+str+"&price="+document.getElementById.(‘price’),true);

You forgot to add the price data… Hope that is it! (Crossing fingers!)

nope…it didn’t do anything…any other help?

So, if you do not use the extra arguments (as they are called), the &price, does it work without it?
If it does, then you need to alert(…) the data and see where the string is not working.
If it doesn’t, then it is your xmlhttp code, not the calling of the php file… Soooo…

Where you have the:
xmlhttp.open(“GET”,“update1.php?q=”+str+"&price="+document.getElementById.(‘price’),true);
put a windows alert there so it show you what you have… Something like this:
alert(“update1.php?q=”+str+"&price="+document.getElementById.(‘price’);
or
window.alert(“update1.php?q=”+str+"&price="+document.getElementById.(‘price’);

And when you execute this, it will pop-up a display that shows what you are actually calling.
This will show you if it is formatted incorrectly. If it is, adjust the line. If not, it is the xmlhttp.open issues…

one idea I have is using something like get element by id. I would use update(price=getelementbyid&product=getelementby id) but i don’t know how I would do this in php using a form like this.

anything?

Ummm, nothing… LOL… Not everyone can respond to you every day. Some of us have lives… LOL

Anyway, you did not answer my questions in my last post. ??? Did you try the alert’s so we can see what you are getting at that point. If you can pinpoint the errors by the data you ARE getting, then we can help you with where you are going wrong… But, we can not see all your code and have to guess when you say things like “anything?” or “one idea you have”… I gave you the testing info you needed to check where your errors are. If you post what you are getting, we can tell you what the problem is. At least, most likely…

Help us help you! LOL…

nothing happened [php][/php]

Not sure about your code.

What does this line do?

xmlhttp.onreadystatechange=function()

You can’t have a function call function as far as I know. I think your code is stopping at that line.
So, I think it never gets to the alert line.

You can always a simple alert and track down where you routine fails.
Use window.alert(“got here…”); and put it at the beginning of your UPDATE function and make sure that it is being called and then move it a couple lines down see where your code is going. In other words, “trace” your UPDATE function to see where it is failing. But, my guess is that line above…

Hi I am looking at your text above, and have basically attempted to do this, however when I put in the iframe on my page, all it does is render text, and not submit the table that I am attempting to get it to.

I have put the table on another web-server however I am not sure if it is appropriately rendering it.

Do you have any suggestions as to how I might be able to get a form to submit to an email address if the server does not support php? I am a newbie, and am building a site very very slowly.

Thanks
AC

So, you want a routine to send an email without using PHP???

Here is one tutorial on how to do this: [url=http://www.tutorialspoint.com/java/java_sending_email.htm
This one does it using Javascript…

Here is another tutorial similar to that one…
[url]https://developers.google.com/appengine/docs/java/mail/usingjavamail]http://www.tutorialspoint.com/java/java_sending_email.htm
This one does it using Javascript…

Here is another tutorial similar to that one…
https://developers.google.com/appengine/docs/java/mail/usingjavamail

Hope that helps…

Sponsor our Newsletter | Privacy Policy | Terms of Service