Skip to content

RsFormPro get a form field selected value and pass to another field

Project details

Dear Sirs

(1) Name : sch_id ; Additional Attributes : onclick=”myFunction()”
Note : Items : is generate by php as below code

//<code>
// Prepare the empty array
$items = array();
// Prepare the database connection
$db = JFactory::getDbo();
// Keep this if you’d like a “Please select” option, otherwise comment or remove it
$items[] = “|Please Select[c]”;

// Run the SQL query and store it in $results
$db->setQuery(“SELECT id, name_en FROM #__ad_scheduler ORDER BY id ASC”); …….

(2) Form Fields : HTML Layout , I add a Ajax Example AND it works

<script>
var xmlhttp;
function loadXMLDoc(url,cfunc)
{ if () {
xmlhttp=new XMLHttpRequest();
} else {
xmlhttp=new ActiveXObject(“”);
}
xmlhttp.onreadystatechange=cfunc;
(“GET”,url,true);
();
}
function myFunction()
{ loadXMLDoc(“/modules/aRsFormPro/”,function()
{ if (xmlhttp.readyState==4 && xmlhttp.status==200)
{ (“myDiv”).innerHTML=;
}
});
}
</script>
<div id=”myDiv”><h2>Display AJAX Content here</h2></div>
<button type=”button” onclick=”myFunction()”>DIsplay Text</button>

MY QUESTION IS

HOW can I get the before submission
something likes $asch_id = [‘form’][‘sch_id’].value;
that I can use $asch_id at another field Name : item_id
//<code>
// Prepare the empty array
$asch_id = 6; <=== the 6 is manually input, I need to get the selected item from Name = sch_id

$items = array();
// Prepare the database connection
$db = JFactory::getDbo();
// Keep this if you’d like a “Please select” option, otherwise comment or remove it
$items[] = “|Please Select[c]”;

// Run the SQL query and store it in $results
$db->setQuery(“SELECT id, name_en FROM #__ad_item WHERE sch_id = $asch_id ORDER BY name_en ASC”);
$results = $db->loadObjectList();

Skills: AJAXPHP

Awarded to:

Project budget: $15 USD / hour
budget limits: $8-15 USD / hour
number of bids: 11
average bids: $14/hour

Do you have a similar project. Contact us now to help you get it done

Email
Project Type*

Awarded to:

Project budget: $15 USD / hour
budget limits: $8-15 USD / hour
number of bids: 11
average bids: $14/hour

Project details

Dear Sirs

(1) Name : sch_id ; Additional Attributes : onclick=”myFunction()”
Note : Items : is generate by php as below code

//<code>
// Prepare the empty array
$items = array();
// Prepare the database connection
$db = JFactory::getDbo();
// Keep this if you’d like a “Please select” option, otherwise comment or remove it
$items[] = “|Please Select[c]”;

// Run the SQL query and store it in $results
$db->setQuery(“SELECT id, name_en FROM #__ad_scheduler ORDER BY id ASC”); …….

(2) Form Fields : HTML Layout , I add a Ajax Example AND it works

<script>
var xmlhttp;
function loadXMLDoc(url,cfunc)
{ if () {
xmlhttp=new XMLHttpRequest();
} else {
xmlhttp=new ActiveXObject(“”);
}
xmlhttp.onreadystatechange=cfunc;
(“GET”,url,true);
();
}
function myFunction()
{ loadXMLDoc(“/modules/aRsFormPro/”,function()
{ if (xmlhttp.readyState==4 && xmlhttp.status==200)
{ (“myDiv”).innerHTML=;
}
});
}
</script>
<div id=”myDiv”><h2>Display AJAX Content here</h2></div>
<button type=”button” onclick=”myFunction()”>DIsplay Text</button>

MY QUESTION IS

HOW can I get the before submission
something likes $asch_id = [‘form’][‘sch_id’].value;
that I can use $asch_id at another field Name : item_id
//<code>
// Prepare the empty array
$asch_id = 6; <=== the 6 is manually input, I need to get the selected item from Name = sch_id


$items = array();
// Prepare the database connection
$db = JFactory::getDbo();
// Keep this if you’d like a “Please select” option, otherwise comment or remove it
$items[] = “|Please Select[c]”;

// Run the SQL query and store it in $results
$db->setQuery(“SELECT id, name_en FROM #__ad_item WHERE sch_id = $asch_id ORDER BY name_en ASC”);
$results = $db->loadObjectList();

Skills: AJAXPHP

Do you have a similar project. Contact us now to help you get it done

Email
Project Type*

Other freelancers

Responsive image

Augurs Technologies

Leading Tech Solutions Provider at Freelancer

4.9 (353 reviews)

Responsive image

Borko R.

Senior full stack developer.

4.8 (17 reviews)

Responsive image

Ravikant P.

Wordpress/FIGMA/Shopify/Graphic Design/HTML/.NET

5.0 (435 reviews)

Responsive image

Mohammad Suman K.

C# | MSSQL | VB | MySQL | .NET Core | MS ACCESS

5.0 (584 reviews)

×

Hello!

Do you have an idea or project. Contact us and we'll get it done for you

× Do you have an idea or project?