Jump to content

Recommended Posts

Hi,

 

I have one html file where I use the following expression:

 

 

<select name=selMonth onchange='changeCal()'>";

 

 

Then, I have another file, this one is a php file, where I want to use the selected value on the dropdown list select object. I tried to use the following expression in the php file but it didn't worked:

 

 

var xpto = parseInt(document.calForm.selMonth.value);

 

 

It presents me nothing...

 

Can someone help me please?

 

 

Regards,

PHP scripts are executed on the server, with the output being sent to the browser. Javascript is then executed on the browser. Sending data to a PHP script on the server is not as straightforward as many would hope, but it can be done, using a process called AJAX which interacts with the server in the background.

 

Can you give more info on what it is you are trying to pass with some concrete examples? This will make it easier to give you suggestions.

Well the first file it's a calendar. The second file (new.php) is loaded when I click in one of the calendar days.

 

 

 

Code:

"<td align=center><span id=sp" + aa + " onclick=\"location.href='new.php?asd=" + aa + "'\"></span> </td>";

I want to pass to the second file, beside the chosen day stored in the "asd" variable, the month and the year choosen. On the firs file both month and year are choosen in the dropdown list.

 

 

Code:

 

 

 


text = "<form name=calForm>";
text += "<table border=1>";
text += "<tr><td>";
text += "<table width=1%><tr>";
text += "<td align=center>";
text += "<select name=selMonth onchange='changeCal()'>"; 

...

text += "<td align=center>";
text += "<select name=selYear onchange='changeCal()'>";


 

How can I change the code to also pass Year and Month for the new.php file?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.