By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,961 Members | 1,803 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,961 IT Pros & Developers. It's quick & easy.

Javascrtipt and AJAX Variable Passing

P: n/a
SOmeone please help me with this. I'm very very very new to
Javascript. I'm trying to basically pass the value of the text box
h-value to a PHP page. So I want do.php?VALUE OF H-VALUE

Look at the link below. how do I do this? I'm sure its easy, but im
havng troulble researchig this.
Value: <input name="h-value" id="h-value"
onChange="s.setValue(parseInt(this.value))"/>

<script type="text/javascript">

var s = new Slider(document.getElementById("slider-1"),
document.getElementById("slider-input-1"));

s.onchange = function () {
document.getElementById("h-value").value = s.getValue();
};
s.setValue(50);

window.onresize = function () {
s.recalculate();
};

</script>

<input name="submit" type="submit" value="submit" />
</form>

<ul id="maintab" class="shadetabs">
<li class="selected"><a href="#default"
rel="ajaxcontentarea">Intro</a></li>
<li><a href="do.php" onClick="s.getValue()" rel="ajaxcontentarea">click
here>
</ul>

Sep 28 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
You're way off...

Here's a sample I threw together...

http://www.davidbetz.net/ajax/ajaxexample092806.htm

You can ignore what's going on on the server... you're only dealing
with the client side.

Basically, you want to create an XmlHttp object and just send off what
you want. You get back... well, you get back whatever you get back.
It's a form of service oriented architecture for JavaScript. It's been
there for almost a decade...

David Betz

am**********@gmail.com wrote:
SOmeone please help me with this. I'm very very very new to
Javascript. I'm trying to basically pass the value of the text box
h-value to a PHP page. So I want do.php?VALUE OF H-VALUE

Look at the link below. how do I do this? I'm sure its easy, but im
havng troulble researchig this.
Value: <input name="h-value" id="h-value"
onChange="s.setValue(parseInt(this.value))"/>

<script type="text/javascript">

var s = new Slider(document.getElementById("slider-1"),
document.getElementById("slider-input-1"));

s.onchange = function () {
document.getElementById("h-value").value = s.getValue();
};
s.setValue(50);

window.onresize = function () {
s.recalculate();
};

</script>

<input name="submit" type="submit" value="submit" />
</form>

<ul id="maintab" class="shadetabs">
<li class="selected"><a href="#default"
rel="ajaxcontentarea">Intro</a></li>
<li><a href="do.php" onClick="s.getValue()" rel="ajaxcontentarea">click
here>
</ul>
Sep 29 '06 #2

P: n/a
<ag******@gmail.comwrote:
>
You can ignore what's going on on the server... you're only dealing
with the client side.
i'm rinning over Mac OS X with Apache 2, then i wonde about the port to
open to let XMLHttpRequest to pass thru because, testing the example u
given raise a :

"Permisson denied to call the method "XMLHttpRequest.open" ????
--
une bévue
Sep 29 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.